@@ -53,37 +53,37 @@ public class HttpConfig implements InitializingBean {
5353
5454 private static final char [] KEYRING_PASSWORD = "password" .toCharArray ();
5555
56- @ Value ("${server.ssl.protocol:TLSv1.2}" )
56+ @ Value ("${apiml.service.ssl.protocol:${ server.ssl.protocol:TLSv1.2} }" )
5757 private String protocol ;
5858
59- @ Value ("${apiml.httpclient .ssl.enabled-protocols:TLSv1.2,TLSv1.3}" )
59+ @ Value ("${apiml.service .ssl.enabled-protocols:TLSv1.2,TLSv1.3}" )
6060 private String [] supportedProtocols ;
6161
62- @ Value ("${server.ssl.ciphers:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384}" )
62+ @ Value ("${apiml.service.ssl.ciphers:${ server.ssl.ciphers:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384} }" )
6363 private String [] ciphers ;
6464
65- @ Value ("${server.ssl.trustStore:#{null}}" )
65+ @ Value ("${apiml.service.ssl.trust-store:${ server.ssl.trustStore:#{null} }}" )
6666 private String trustStorePath ;
6767
68- @ Value ("${server.ssl.trustStorePassword:#{null}}" )
68+ @ Value ("${apiml.service.ssl.trust-store-password:${ server.ssl.trustStorePassword:#{null} }}" )
6969 private char [] trustStorePassword ;
7070
71- @ Value ("${server.ssl.trustStoreType:PKCS12}" )
71+ @ Value ("${apiml.service.ssl.trust-store-type:${ server.ssl.trustStoreType:PKCS12} }" )
7272 private String trustStoreType ;
7373
74- @ Value ("${server.ssl.keyAlias:#{null}}" )
74+ @ Value ("${apiml.service.ssl.key-alias:${ server.ssl.keyAlias:#{null} }}" )
7575 private String keyAlias ;
7676
77- @ Value ("${server.ssl.keyStore:#{null}}" )
77+ @ Value ("${apiml.service.ssl.key-store:${ server.ssl.keyStore:#{null} }}" )
7878 private String keyStorePath ;
7979
80- @ Value ("${server.ssl.keyStorePassword:#{null}}" )
80+ @ Value ("${apiml.service.ssl.key-store-password:${ server.ssl.keyStorePassword:#{null} }}" )
8181 private char [] keyStorePassword ;
8282
83- @ Value ("${server.ssl.keyPassword:#{null}}" )
83+ @ Value ("${apiml.service.ssl.key-password:${ server.ssl.keyPassword:#{null} }}" )
8484 private char [] keyPassword ;
8585
86- @ Value ("${server.ssl.keyStoreType:PKCS12}" )
86+ @ Value ("${apiml.service.ssl.key-store-type:${ server.ssl.keyStoreType:PKCS12} }" )
8787 private String keyStoreType ;
8888
8989 @ Value ("${apiml.security.ssl.verifySslCertificatesOfServices:true}" )
@@ -92,7 +92,7 @@ public class HttpConfig implements InitializingBean {
9292 @ Value ("${apiml.security.ssl.nonStrictVerifySslCertificatesOfServices:false}" )
9393 private boolean nonStrictVerifySslCertificatesOfServices ;
9494
95- @ Value ("${server.ssl.trustStoreRequired:false}" )
95+ @ Value ("${apiml.service.ssl.trust-store-required:${ server.ssl.trustStoreRequired:false} }" )
9696 private boolean trustStoreRequired ;
9797
9898 @ Value ("${server.maxConnectionsPerRoute:#{10}}" )
@@ -123,17 +123,26 @@ public class HttpConfig implements InitializingBean {
123123 private final ApplicationContext context ;
124124
125125 void updateStorePaths () {
126- ServerProperties serverProperties = context .getBean (ServerProperties .class );
127126 if (SecurityUtils .isKeyring (keyStorePath )) {
128127 keyStorePath = SecurityUtils .formatKeyringUrl (keyStorePath );
129- serverProperties .getSsl ().setKeyStore (keyStorePath );
130128 if (keyStorePassword == null ) keyStorePassword = KEYRING_PASSWORD ;
131129 }
132130 if (SecurityUtils .isKeyring (trustStorePath )) {
133131 trustStorePath = SecurityUtils .formatKeyringUrl (trustStorePath );
134- serverProperties .getSsl ().setTrustStore (trustStorePath );
135132 if (trustStorePassword == null ) trustStorePassword = KEYRING_PASSWORD ;
136133 }
134+
135+ ServerProperties serverProperties = context .getBean (ServerProperties .class );
136+ if (serverProperties .getSsl () != null ) {
137+ String serverKeyStore = serverProperties .getSsl ().getKeyStore ();
138+ if (SecurityUtils .isKeyring (serverKeyStore )) {
139+ serverProperties .getSsl ().setKeyStore (SecurityUtils .formatKeyringUrl (serverKeyStore ));
140+ }
141+ String serverTrustStore = serverProperties .getSsl ().getTrustStore ();
142+ if (SecurityUtils .isKeyring (serverTrustStore )) {
143+ serverProperties .getSsl ().setTrustStore (SecurityUtils .formatKeyringUrl (serverTrustStore ));
144+ }
145+ }
137146 }
138147
139148 @ Override
0 commit comments