Openldap在握手时不发送证书

我正在尝试在Ubuntu 16.04上为我的OpenLDAP服务器设置PWM ,但是无法连接到有错误的LDAP

Can not connect to remote server: 5059 ERROR_CERTIFICATE_ERROR (unable to read server certificates from host=ldap.example.com, port=389 error: Remote host closed connection during handshake)

如果我试图连接未encryption,连接似乎是成功的,但设置一个PWM帐户失败, TLS confidentiality required ,这是故意的。

客户端和ldapsearch(使用开关-Z或-ZZ)身份validation工作。
我已经将证书文件导入到服务器机器上的客户端和Java,因为证书是使用openssl自签名的。

我尝试使用openssl s_client -connect ldap.example:389 -showcerts -state -tls1_2连接到LDAP来检查证书,但连接终止,没有错误消息,并且此输出:

 CONNECTED(00000003) SSL_connect:before/connect initialization SSL_connect:unknown state SSL_connect:failed in unknown state 140394455615128:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:s3_pkt.c:656: --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 0 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : 0000 Session-ID: Session-ID-ctx: Master-Key: Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1484029284 Timeout : 7200 (sec) Verify return code: 0 (ok) --- 

连接到端口443输出证书。
我真的不知道该怎么做,所以任何帮助,将不胜感激。

389 \ TCP默认情况下不是LDAP SSL端口。 端口636 \ TCP通常用于LDAP SSL(ldaps)。

389 \ TCP端口可以​​启用STARTTLS( ldapsearch与开关-Z-ZZ使用它)。 我不确定OpenSSL s_client是否能够为LDAP协议实现STARTTLS。