我正在尝试使用TLS连接到apached,但我得到了一个LdapOperationException:
PROTOCOL_ERROR:服务器将断开连接!
下面是我的代码:
LdapNetworkConnection connection = null;
LdapConnectionConfig ldapConnectionConfig = new LdapConnectionConfig();
ldapConnectionConfig.setUseTls(true);
ldapConnectionConfig.setLdapHost("localhost");
ldapConnectionConfig.setLdapPort(10636);
ldapConnectionConfig.setTrustManagers(new X509TrustManager(){
public X509Certificate[] getAcceptedIssuers(){
return new X509Certificate[0];
}
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException{}
public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException{}
});
connection = new LdapNetworkConnection(ldapConnectionConfig);
connection.connect();
try{
connection.startTls();
}catch(LdapException e){
e.printStackTrace();
}会有什么问题呢?
发布于 2013-12-24 15:21:05
使用端口10389,10636用于LDAPS连接。
https://stackoverflow.com/questions/20751594
复制相似问题