Skip to content

Commit 688db88

Browse files
#971 - Pass the trustmanager to the SSLContext
(cherry picked from commit ad7a6ff)
1 parent dce0044 commit 688db88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import javax.net.ssl.KeyManagerFactory;
3131
import javax.net.ssl.SSLContext;
3232
import javax.net.ssl.SSLException;
33+
import javax.net.ssl.TrustManager;
3334
import javax.net.ssl.X509TrustManager;
3435

3536
import okhttp3.OkHttpClient;
@@ -628,7 +629,8 @@ private SSLContext createSSLContext()
628629
+ "Service provider Implementaion (SPI) is invalid. CertificateAuthContext "
629630
+ "requires SunX509 algorithm and PKCS12 Key store SPI", e);
630631
}
631-
sslContext.init(keyMgr, null, null);
632+
TrustManager[] trustManagers = trustManager == null ? null : new TrustManager[] {trustManager};
633+
sslContext.init(keyMgr, trustManagers, null);
632634
return sslContext;
633635
}
634636

0 commit comments

Comments
 (0)