Openssl 例程:SSL23_写入:ssl握手失败

Openssl 例程:SSL23_写入:ssl握手失败,openssl,xmpp,Openssl,Xmpp,当尝试通过SSL连接到xmpp服务器时,openssl失败并出现以下错误:3071833836:错误:140790E5:SSL例程:SSL23_WRITE:SSL握手失败:s23_lib.c:177 我相信服务器使用的是RC4-MD5密码,下面是完整的输出: [root@localhost ~]# openssl s_client -connect 184.106.52.124:5222 -cipher RC4-MD5 CONNECTED(00000003) >>> SSL 2

当尝试通过SSL连接到xmpp服务器时,openssl失败并出现以下错误:3071833836:错误:140790E5:SSL例程:SSL23_WRITE:SSL握手失败:s23_lib.c:177

我相信服务器使用的是RC4-MD5密码,下面是完整的输出:

[root@localhost ~]# openssl s_client -connect 184.106.52.124:5222 -cipher RC4-MD5
CONNECTED(00000003)
>>> SSL 2.0 [length 0032], CLIENT-HELLO
    01 03 03 00 09 00 00 00 20 00 00 04 01 00 80 00
    00 ff b0 c9 c2 3f 0b 0e 98 df b4 dc fe b7 e8 8f
    17 9a 34 b5 9b 17 1b 2b ac 01 dc bd 2b a9 2d 18
    44 0c
3071866604:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 52 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
使用gnutls cli:

[root@localhost ~]# gnutls-cli 184.106.52.124 -p 5222
Resolving '184.106.52.124'...
Connecting to '184.106.52.124:5222'...
*** Fatal error: A TLS packet with unexpected length was received.
*** Handshake has failed
GNUTLS ERROR: A TLS packet with unexpected length was received.
在端口5223上连接到同一台服务器可以正常工作

在CentOS 6.5上使用OpenSSL 1.0.1e-fips 以及Ubuntu 14.04.1上的OpenSSL 1.0.1f

有关于如何解决此问题的提示吗?
提前感谢。

在端口5222上,您应该使用STARTTLS()协商TLS的使用。对于
openssl s_客户端
,请尝试添加
-starttls xmpp

。此问题似乎与主题无关,因为它与编程无关。请参见帮助中心中的。也许会是一个更好的提问地点。谢谢你的回答,但他们不使用starttls。这是XMPP,是kik messenger windows应用程序服务器,他们的android应用程序使用端口5223,我在连接时没有遇到问题。