Formatting
see gh-3551
This commit is contained in:
@@ -67,10 +67,10 @@ public abstract class AbstractSslConfigurer<T, S> {
|
||||
}
|
||||
|
||||
protected SslBundle getBundle() {
|
||||
if(ssl.getSslBundle() == null || ssl.getSslBundle().length() > 0) {
|
||||
if (ssl.getSslBundle() == null || ssl.getSslBundle().length() > 0) {
|
||||
return null;
|
||||
}
|
||||
if(bundles.getBundleNames().contains(ssl.getSslBundle())) {
|
||||
if (bundles.getBundleNames().contains(ssl.getSslBundle())) {
|
||||
return bundles.getBundle(ssl.getSslBundle());
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -757,8 +757,7 @@ public class GatewayAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public HttpClientSslConfigurer httpClientSslConfigurer(ServerProperties serverProperties,
|
||||
HttpClientProperties httpClientProperties,
|
||||
SslBundles bundles) {
|
||||
HttpClientProperties httpClientProperties, SslBundles bundles) {
|
||||
return new HttpClientSslConfigurer(httpClientProperties.getSsl(), serverProperties, bundles) {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ public class HttpClientSslConfigurer extends AbstractSslConfigurer<HttpClient, H
|
||||
|
||||
private final ServerProperties serverProperties;
|
||||
|
||||
public HttpClientSslConfigurer(HttpClientProperties.Ssl sslProperties, ServerProperties serverProperties, SslBundles bundles) {
|
||||
public HttpClientSslConfigurer(HttpClientProperties.Ssl sslProperties, ServerProperties serverProperties,
|
||||
SslBundles bundles) {
|
||||
super(sslProperties, bundles);
|
||||
this.serverProperties = serverProperties;
|
||||
}
|
||||
@@ -67,7 +68,7 @@ public class HttpClientSslConfigurer extends AbstractSslConfigurer<HttpClient, H
|
||||
}
|
||||
|
||||
try {
|
||||
if(bundle != null) {
|
||||
if (bundle != null) {
|
||||
sslContextBuilder.keyManager(bundle.getManagers().getKeyManagerFactory());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -351,8 +351,7 @@ public class GatewayAutoConfigurationTests {
|
||||
@Bean
|
||||
@Primary
|
||||
CustomSslConfigurer customSslContextFactory(ServerProperties serverProperties,
|
||||
HttpClientProperties httpClientProperties,
|
||||
SslBundles bundles) {
|
||||
HttpClientProperties httpClientProperties, SslBundles bundles) {
|
||||
return new CustomSslConfigurer(httpClientProperties.getSsl(), serverProperties, bundles);
|
||||
}
|
||||
|
||||
@@ -365,6 +364,7 @@ public class GatewayAutoConfigurationTests {
|
||||
});
|
||||
return registry;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static class CustomHttpClientFactory extends HttpClientFactory {
|
||||
@@ -408,7 +408,8 @@ public class GatewayAutoConfigurationTests {
|
||||
|
||||
boolean insecureTrustManagerSet;
|
||||
|
||||
protected CustomSslConfigurer(HttpClientProperties.Ssl sslProperties, ServerProperties serverProperties, SslBundles bundles) {
|
||||
protected CustomSslConfigurer(HttpClientProperties.Ssl sslProperties, ServerProperties serverProperties,
|
||||
SslBundles bundles) {
|
||||
super(sslProperties, serverProperties, bundles);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user