我在 Fedora 19 计算机上使用 xmpppy 连接到需要 ssl 连接的 xmpp 服务器。
代码:
client = xmpp.Client(self.domain, debug=[])
server = (self.server, 5222)
client.connect(server)
它工作正常,我没有更改代码中的任何内容。然后我安装了一些应用程序并更新了 Fedora,现在它给出了这个错误:
Traceback (most recent call last):
File "chat.py", line 20, in connect
client.connect(server)
File "/usr/lib/python2.7/site-packages/xmpp/client.py", line 205, in connect
while not self.TLS.starttls and self.Process(1): pass
File "/usr/lib/python2.7/site-packages/xmpp/dispatcher.py", line 303, in dispatch
handler['func'](session,stanza)
File "/usr/lib/python2.7/site-packages/xmpp/transports.py", line 337, in StartTLSHandler
self._startSSL()
File "/usr/lib/python2.7/site-packages/xmpp/transports.py", line 315, in _startSSL
tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
File "/usr/lib64/python2.7/socket.py", line 64, in ssl
return _realssl.sslwrap_simple(sock, keyfile, certfile)
File "/usr/lib64/python2.7/ssl.py", line 477, in sslwrap_simple
ssl_sock.do_handshake()
ssl.SSLError: [Errno 1] _ssl.c:504: error:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group
我还尝试使用 PHP 连接到 XMPP 服务器
$this->send_xml($this->START_TLS);
$xml = $this->recv_xml();
stream_socket_enable_crypto($this->fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
但它抛出
PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group
error:1408D010:SSL routines:SSL3_GET_KEY_EXCHANGE:EC lib in /var/www/html/libs/xmpp.php on line 71