2525import java .net .InetSocketAddress ;
2626import java .net .MalformedURLException ;
2727import java .net .ServerSocket ;
28- import java .net .Socket ;
2928import java .net .URI ;
3029import java .net .URISyntaxException ;
3130import java .net .URL ;
7574import org .apache .http .impl .client .HttpClientBuilder ;
7675import org .apache .http .impl .client .HttpClients ;
7776import org .apache .http .protocol .HttpContext ;
78- import org .apache .http .ssl .PrivateKeyDetails ;
79- import org .apache .http .ssl .PrivateKeyStrategy ;
8077import org .apache .http .ssl .SSLContextBuilder ;
8178import org .apache .http .ssl .TrustStrategy ;
8279import org .apache .jasper .EmbeddedServletOptions ;
@@ -503,16 +500,7 @@ public void pkcs12KeyStoreAndTrustStore() throws Exception {
503500 new SSLContextBuilder ()
504501 .loadTrustMaterial (null , new TrustSelfSignedStrategy ())
505502 .loadKeyMaterial (keyStore , "secret" .toCharArray (),
506- new PrivateKeyStrategy () {
507-
508- @ Override
509- public String chooseAlias (
510- Map <String , PrivateKeyDetails > aliases ,
511- Socket socket ) {
512- return "spring-boot" ;
513- }
514-
515- })
503+ (aliases , socket ) -> "spring-boot" )
516504 .build ());
517505 HttpClient httpClient = HttpClients .custom ().setSSLSocketFactory (socketFactory )
518506 .build ();
@@ -538,15 +526,7 @@ public void sslNeedsClientAuthenticationSucceedsWithClientCertificate()
538526 new SSLContextBuilder ()
539527 .loadTrustMaterial (null , new TrustSelfSignedStrategy ())
540528 .loadKeyMaterial (keyStore , "password" .toCharArray (),
541- new PrivateKeyStrategy () {
542-
543- @ Override
544- public String chooseAlias (
545- Map <String , PrivateKeyDetails > aliases ,
546- Socket socket ) {
547- return "spring-boot" ;
548- }
549- })
529+ (aliases , socket ) -> "spring-boot" )
550530 .build ());
551531 HttpClient httpClient = HttpClients .custom ().setSSLSocketFactory (socketFactory )
552532 .build ();
@@ -639,15 +619,7 @@ public void sslWithCustomSslStoreProvider() throws Exception {
639619 new SSLContextBuilder ()
640620 .loadTrustMaterial (null , new TrustSelfSignedStrategy ())
641621 .loadKeyMaterial (keyStore , "password" .toCharArray (),
642- new PrivateKeyStrategy () {
643-
644- @ Override
645- public String chooseAlias (
646- Map <String , PrivateKeyDetails > aliases ,
647- Socket socket ) {
648- return "spring-boot" ;
649- }
650- })
622+ (aliases , socket ) -> "spring-boot" )
651623 .build ());
652624 HttpClient httpClient = HttpClients .custom ().setSSLSocketFactory (socketFactory )
653625 .build ();
0 commit comments