Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/ssl-2way-project/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id "net.saliman.properties" version "1.5.1"
id "com.marklogic.ml-gradle" version "4.5.2"
}

Expand Down Expand Up @@ -77,10 +78,11 @@ if (project.hasProperty("mlKeystore")) {
KeyManager[] key = keyManagerFactory.getKeyManagers()

// Initialize the SSL context with key and trust managers.
SSLContext sslContext = SSLContext.getInstance("SSLv3")
SSLContext sslContext = SSLContext.getInstance("TLSv1.2")
sslContext.init(key, trust, null)

restSslContext = sslContext
restTrustManager = trust[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for trust to be an empty array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that would require using a JVM with an empty cacerts file with no trust managers. That seems very unlikely, and given that this is only example code, that's something a user would get a hard error on - which is probably better than failing by not passing in any trust manager at all.


// This turns off hostname verification unless mlVerifyServerHostname=true
if (project.hasProperty("mlVerifyServerHostname") && mlVerifyServerHostname.toBoolean()) {
Expand Down