Create SSLParameters if SSLSocket returns null reference
On some JDKs the SSLSocket#getSSLParameters method can return null,
which triggers an NPE in the driver.  To work around this, construct a
new SSLParameters instance when null is returned, so that SNI and host
name validation properties can be set on it before calling
SSLSocket#setSSLParameters.
@@ -50,6 +50,9 @@ final class SocketStreamHelper {
}
SSLSocket sslSocket = (SSLSocket) socket;
SSLParameters sslParameters = sslSocket.getSSLParameters();
+ if (sslParameters == null) {
+ sslParameters = new SSLParameters();
+ }
enableSni(address, sslParameters);
