import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
+import org.springframework.core.env.Profiles;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
RestTemplate restTemplate = null;
- if (env.acceptsProfiles("one-way-ssl", "two-way-ssl")) {
+ if (env.acceptsProfiles(Profiles.of("one-way-ssl", "two-way-ssl"))) {
char[] trustStorePassword =
env.getProperty("server.ssl.trust-store-password").toCharArray();
char[] keyStorePassword =
String trustStore = env.getProperty("server.ssl.trust-store");
SSLContextBuilder sslContextBuilder = SSLContextBuilder.create();
- if (env.acceptsProfiles("two-way-ssl")) {
+ if (env.acceptsProfiles(Profiles.of("two-way-ssl"))) {
sslContextBuilder = sslContextBuilder
.loadKeyMaterial(loadPfx(keyStore, keyStorePassword), keyStorePassword);
}