8211107: LDAPS communication failure with jdk 1.8.0_181

Reviewed-by: chegar, coffeys, vtewari
This commit is contained in:
Prasadrao Koppula 2018-10-02 21:38:54 +05:30
parent 40b75053e4
commit c55d60acf7

View File

@ -337,17 +337,17 @@ public final class Connection implements Runnable {
// then reset the timeout.
if (socket instanceof SSLSocket) {
SSLSocket sslSocket = (SSLSocket) socket;
int socketTimeout = sslSocket.getSoTimeout();
if (!IS_HOSTNAME_VERIFICATION_DISABLED) {
SSLParameters param = sslSocket.getSSLParameters();
param.setEndpointIdentificationAlgorithm("LDAPS");
sslSocket.setSSLParameters(param);
}
if (connectTimeout > 0) {
int socketTimeout = sslSocket.getSoTimeout();
sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value
sslSocket.startHandshake();
sslSocket.setSoTimeout(socketTimeout);
}
sslSocket.startHandshake();
sslSocket.setSoTimeout(socketTimeout);
}
return socket;
}