@ -397,7 +397,7 @@ public abstract class AbstractServletWebServerFactoryTests {
@@ -397,7 +397,7 @@ public abstract class AbstractServletWebServerFactoryTests {
new ExampleServlet ( true , false ) , "/hello" ) ;
this . webServer = factory . getWebServer ( registration ) ;
this . webServer . start ( ) ;
TrustStrategy trustStrategy = new SerialNumberValidatingTrustSelfSignedStrategy ( "5c7ae101 " ) ;
TrustStrategy trustStrategy = new SerialNumberValidatingTrustSelfSignedStrategy ( "3a3aaec8 " ) ;
SSLContext sslContext = new SSLContextBuilder ( ) . loadTrustMaterial ( null , trustStrategy ) . build ( ) ;
HttpClient httpClient = HttpClients . custom ( ) . setSSLSocketFactory ( new SSLConnectionSocketFactory ( sslContext ) )
. build ( ) ;
@ -459,7 +459,7 @@ public abstract class AbstractServletWebServerFactoryTests {
@@ -459,7 +459,7 @@ public abstract class AbstractServletWebServerFactoryTests {
keyStore . load ( new FileInputStream ( new File ( "src/test/resources/test.p12" ) ) , "secret" . toCharArray ( ) ) ;
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory (
new SSLContextBuilder ( ) . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) )
. loadKeyMaterial ( keyStore , "secret" . toCharArray ( ) , ( aliases , socket ) - > "spring-boot" ) . build ( ) ) ;
. loadKeyMaterial ( keyStore , "secret" . toCharArray ( ) ) . build ( ) ) ;
HttpClient httpClient = HttpClients . custom ( ) . setSSLSocketFactory ( socketFactory ) . build ( ) ;
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory ( httpClient ) ;
assertThat ( getResponse ( getLocalUrl ( "https" , "/test.txt" ) , requestFactory ) ) . isEqualTo ( "test" ) ;
@ -474,9 +474,9 @@ public abstract class AbstractServletWebServerFactoryTests {
@@ -474,9 +474,9 @@ public abstract class AbstractServletWebServerFactoryTests {
this . webServer . start ( ) ;
KeyStore keyStore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ;
keyStore . load ( new FileInputStream ( new File ( "src/test/resources/test.jks" ) ) , "secret" . toCharArray ( ) ) ;
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory ( new SSLContextBuilder ( )
. loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) )
. loadKeyMaterial ( keyStore , "password" . toCharArray ( ) , ( aliases , socket ) - > "spring-boot" ) . build ( ) ) ;
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory (
new SSLContextBuilder ( ) . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) )
. loadKeyMaterial ( keyStore , "password" . toCharArray ( ) ) . build ( ) ) ;
HttpClient httpClient = HttpClients . custom ( ) . setSSLSocketFactory ( socketFactory ) . build ( ) ;
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory ( httpClient ) ;
assertThat ( getResponse ( getLocalUrl ( "https" , "/test.txt" ) , requestFactory ) ) . isEqualTo ( "test" ) ;
@ -545,9 +545,9 @@ public abstract class AbstractServletWebServerFactoryTests {
@@ -545,9 +545,9 @@ public abstract class AbstractServletWebServerFactoryTests {
this . webServer . start ( ) ;
KeyStore keyStore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ;
keyStore . load ( new FileInputStream ( new File ( "src/test/resources/test.jks" ) ) , "secret" . toCharArray ( ) ) ;
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory ( new SSLContextBuilder ( )
. loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) )
. loadKeyMaterial ( keyStore , "password" . toCharArray ( ) , ( aliases , socket ) - > "spring-boot" ) . build ( ) ) ;
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory (
new SSLContextBuilder ( ) . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) )
. loadKeyMaterial ( keyStore , "password" . toCharArray ( ) ) . build ( ) ) ;
HttpClient httpClient = HttpClients . custom ( ) . setSSLSocketFactory ( socketFactory ) . build ( ) ;
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory ( httpClient ) ;
assertThat ( getResponse ( getLocalUrl ( "https" , "/test.txt" ) , requestFactory ) ) . isEqualTo ( "test" ) ;