2015-09-10 138 views
0

我們遇到了openldap的問題。 看來2天前證書已過期。所以生成了新的。 他們看起來很好。openldap:TLS:error:tlsm_PR_Recv返回0 - 錯誤22:無效參數

當我做的ldapsearch我得到如下:

[[email protected] certs]# ldapsearch -H ldaps://xxx -D "cn=xxx,dc=xxx,dc=xxx" -W -b "ou=people,dc=xxx,dc=xxx" -d255 -v -x 
ldap_url_parse_ext(ldaps://xxx) 
ldap_initialize(ldaps://xxx:636/??base) 
ldap_create 
ldap_url_parse_ext(ldaps://xxx:636/??base) 
Enter LDAP Password: 
ldap_sasl_bind 
ldap_send_initial_request 
ldap_new_connection 1 1 0 
ldap_int_open_connection 
ldap_connect_to_host: TCP xxx:636 
ldap_new_socket: 3 
ldap_prepare_socket: 3 
ldap_connect_to_host: Trying xxx:636 
ldap_pvt_connect: fd: 3 tm: -1 async: 0 
attempting to connect: 
connect success 
TLS: loaded CA certificate file /etc/pki/tls/certs/xxx.pem. 
tls_write: want=157, written=157 
    0000: 16 03 01 00 98 01 00 00 94 03 01 fd bf cb 8f 48 ...............H 
    0010: 0b ef 1e c6 6e f3 b6 50 87 74 9e 2e 21 74 2d b6 ....n..P.t..!t-. 
    0020: a2 e9 49 90 72 56 1a a8 58 54 24 00 00 54 c0 0a ..I.rV..XT$..T.. 
    0030: c0 09 c0 13 c0 14 c0 08 c0 12 c0 07 c0 11 00 33 ...............3 
    0040: 00 32 00 45 00 44 00 39 00 38 00 88 00 87 00 16 .2.E.D.9.8...... 
    0050: 00 13 00 66 c0 04 c0 0e c0 05 c0 0f c0 03 c0 0d ...f............ 
    0060: c0 02 c0 0c 00 2f 00 41 00 35 00 84 00 96 00 0a ...../.A.5...... 
    0070: 00 05 00 04 00 15 00 12 00 09 00 64 00 62 00 03 ...........d.b.. 
    0080: 00 06 01 00 00 17 ff 01 00 01 00 00 0a 00 08 00 ................ 
    0090: 06 00 17 00 18 00 19 00 0b 00 02 01 00   ............. 
tls_read: want=5, got=0 

TLS: error: tlsm_PR_Recv returned 0 - error 22:Invalid argument 
TLS: error: connect - force handshake failure: errno 22 - moznss error -5938 
TLS: can't connect: TLS error -5938:Encountered end of file. 
ldap_err2string 
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) 

相信的配置是正確的。 cacert pem文件保持不變,cert和key pem文件已添加到同一目錄中,slapd.conf和ldap.conf已更新爲指向那些文件。

不確定使用openssl s_client -connect應否打開SSL連接。看起來好像根本沒有返回SSL證書。 我也嘗試將配置更改回原來的(所以使用舊的證書),但顯示相同的行爲(這些都過期了,以便可以在這種情況下解釋)。 從我在文檔中看到的有效服務器證書是必要的。

請注意,這是一個同步ldap設置。

調試手搖到最大,這似乎相關的唯一事情是 connection_read(13):TLS接受失敗錯誤= -1 ID = 1055,收盤 ... 康恩= 1055 FD = 13封閉( TLS協商失敗)

在此先感謝您的幫助!

回答

0

所以花費了太多的時間嘗試之後,然後發帖然後想: 也許還有其他地方這個證書配置

我進入了/etc/openldap,併爲出現pem而grepped。在slap.d中也有匹配(我之前從未與ldap一起工作過,所以我認爲這是你在1配置中配置的東西,而不是5個具有相同值的地方)。 編輯所有發生並重新啓動slapd服務 ...現在可用(緩存過期後)。

這是我見過的最糟糕的錯誤消息之一。在調試時,日誌中沒有任何特定的信息是最大的。

希望它可以幫助別人!

相關問題