提交 3eb34875 编写于 作者: P pkoppula

8211107: LDAPS communication failure with jdk 1.8.0_181

Reviewed-by: chegar, coffeys, vtewari
上级 e38bc57c
...@@ -382,17 +382,17 @@ public final class Connection implements Runnable { ...@@ -382,17 +382,17 @@ public final class Connection implements Runnable {
// then reset the timeout. // then reset the timeout.
if (socket instanceof SSLSocket) { if (socket instanceof SSLSocket) {
SSLSocket sslSocket = (SSLSocket) socket; SSLSocket sslSocket = (SSLSocket) socket;
int socketTimeout = sslSocket.getSoTimeout();
if (!IS_HOSTNAME_VERIFICATION_DISABLED) { if (!IS_HOSTNAME_VERIFICATION_DISABLED) {
SSLParameters param = sslSocket.getSSLParameters(); SSLParameters param = sslSocket.getSSLParameters();
param.setEndpointIdentificationAlgorithm("LDAPS"); param.setEndpointIdentificationAlgorithm("LDAPS");
sslSocket.setSSLParameters(param); sslSocket.setSSLParameters(param);
} }
if (connectTimeout > 0) { if (connectTimeout > 0) {
int socketTimeout = sslSocket.getSoTimeout();
sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value
sslSocket.startHandshake();
sslSocket.setSoTimeout(socketTimeout);
} }
sslSocket.startHandshake();
sslSocket.setSoTimeout(socketTimeout);
} }
return socket; return socket;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册