@@ -105,7 +105,7 @@ void digestAuthentication() throws Exception {
105105 DatabaseClient clientWithCert = Common .newClientBuilder ()
106106 .withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
107107 .withSSLContext (createSSLContextWithClientCertificate (keyStoreFile ))
108- .withTrustManager (RequireSSLExtension .newTrustManager ())
108+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
109109 .build ();
110110
111111 verifyTestDocumentCanBeRead (clientWithCert );
@@ -114,7 +114,7 @@ void digestAuthentication() throws Exception {
114114 DatabaseClient clientWithoutCert = Common .newClientBuilder ()
115115 .withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
116116 .withSSLProtocol ("TLSv1.2" )
117- .withTrustManager (RequireSSLExtension .newTrustManager ())
117+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
118118 .build ();
119119
120120 // The type of SSL failure varies across Java versions, so not asserting on a particular error message.
@@ -142,7 +142,7 @@ void certificateAuthenticationWithSSLContext() throws Exception {
142142 try {
143143 SSLContext sslContext = createSSLContextWithClientCertificate (keyStoreFile );
144144 DatabaseClient client = Common .newClientBuilder ()
145- .withCertificateAuth (sslContext , RequireSSLExtension .newTrustManager ())
145+ .withCertificateAuth (sslContext , RequireSSLExtension .newSecureTrustManager ())
146146 .withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
147147 .build ();
148148
@@ -166,7 +166,7 @@ void certificateAuthenticationWithCertificateFileAndPassword() {
166166 try {
167167 DatabaseClient client = Common .newClientBuilder ()
168168 .withCertificateAuth (p12File .getAbsolutePath (), KEYSTORE_PASSWORD )
169- .withTrustManager (RequireSSLExtension .newTrustManager ())
169+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
170170 .withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
171171 .build ();
172172
@@ -200,7 +200,7 @@ private SSLContext createSSLContextWithClientCertificate(File keystoreFile) thro
200200 SSLContext sslContext = SSLContext .getInstance ("TLSv1.2" );
201201 sslContext .init (
202202 keyManagerFactory .getKeyManagers (),
203- new X509TrustManager []{RequireSSLExtension .newTrustManager ()},
203+ new X509TrustManager []{RequireSSLExtension .newSecureTrustManager ()},
204204 null );
205205 return sslContext ;
206206 }
0 commit comments