2013-12-23 2 views
0

실패했지만 나는 LdapOperationException 가지고 :connection.startTls는() 나는 TLS를 사용하여 apacheds에 연결을 시도하고

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(); 
    } 

무슨 문제가 될 수있다 : 여기

내 코드?

답변

1

포트 10389를 사용하십시오. 10636은 LDAPS 연결 용입니다.

+0

여전히 작동하지 않습니다. 동일한 오류입니다. –

관련 문제