提交 f0c2f4cf 编写于 作者: R robm

8214440: ldap over a TLS connection negotiate failed with...

8214440: ldap over a TLS connection negotiate failed with "javax.net.ssl.SSLPeerUnverifiedException: hostname of the server '' does not match the hostname in the server's certificate"
Reviewed-by: vtewari, xuelei
上级 b3991477
...@@ -288,7 +288,8 @@ final public class StartTlsResponseImpl extends StartTlsResponse { ...@@ -288,7 +288,8 @@ final public class StartTlsResponseImpl extends StartTlsResponse {
*/ */
public void setConnection(Connection ldapConnection, String hostname) { public void setConnection(Connection ldapConnection, String hostname) {
this.ldapConnection = ldapConnection; this.ldapConnection = ldapConnection;
this.hostname = (hostname != null) ? hostname : ldapConnection.host; this.hostname = (hostname == null || hostname.isEmpty())
? ldapConnection.host : hostname;
originalInputStream = ldapConnection.inStream; originalInputStream = ldapConnection.inStream;
originalOutputStream = ldapConnection.outStream; originalOutputStream = ldapConnection.outStream;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册