@@ -105,7 +105,7 @@ void digestAuthentication() throws Exception {
105
105
DatabaseClient clientWithCert = Common .newClientBuilder ()
106
106
.withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
107
107
.withSSLContext (createSSLContextWithClientCertificate (keyStoreFile ))
108
- .withTrustManager (RequireSSLExtension .newTrustManager ())
108
+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
109
109
.build ();
110
110
111
111
verifyTestDocumentCanBeRead (clientWithCert );
@@ -114,7 +114,7 @@ void digestAuthentication() throws Exception {
114
114
DatabaseClient clientWithoutCert = Common .newClientBuilder ()
115
115
.withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
116
116
.withSSLProtocol ("TLSv1.2" )
117
- .withTrustManager (RequireSSLExtension .newTrustManager ())
117
+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
118
118
.build ();
119
119
120
120
// 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 {
142
142
try {
143
143
SSLContext sslContext = createSSLContextWithClientCertificate (keyStoreFile );
144
144
DatabaseClient client = Common .newClientBuilder ()
145
- .withCertificateAuth (sslContext , RequireSSLExtension .newTrustManager ())
145
+ .withCertificateAuth (sslContext , RequireSSLExtension .newSecureTrustManager ())
146
146
.withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
147
147
.build ();
148
148
@@ -166,7 +166,7 @@ void certificateAuthenticationWithCertificateFileAndPassword() {
166
166
try {
167
167
DatabaseClient client = Common .newClientBuilder ()
168
168
.withCertificateAuth (p12File .getAbsolutePath (), KEYSTORE_PASSWORD )
169
- .withTrustManager (RequireSSLExtension .newTrustManager ())
169
+ .withTrustManager (RequireSSLExtension .newSecureTrustManager ())
170
170
.withSSLHostnameVerifier (DatabaseClientFactory .SSLHostnameVerifier .ANY )
171
171
.build ();
172
172
@@ -200,7 +200,7 @@ private SSLContext createSSLContextWithClientCertificate(File keystoreFile) thro
200
200
SSLContext sslContext = SSLContext .getInstance ("TLSv1.2" );
201
201
sslContext .init (
202
202
keyManagerFactory .getKeyManagers (),
203
- new X509TrustManager []{RequireSSLExtension .newTrustManager ()},
203
+ new X509TrustManager []{RequireSSLExtension .newSecureTrustManager ()},
204
204
null );
205
205
return sslContext ;
206
206
}
0 commit comments