1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 17:25:11 +00:00
nixpkgs/pkgs/development/python-modules/xmpppy/ssl.patch
2017-01-19 19:10:16 +01:00

26 lines
1.2 KiB
Diff

diff -wbBur xmpppy-0.5.0rc1/xmpp/transports.py xmpppy-0.5.0rc1.q/xmpp/transports.py
--- xmpppy-0.5.0rc1/xmpp/transports.py 2009-04-07 12:34:09.000000000 +0400
+++ xmpppy-0.5.0rc1.q/xmpp/transports.py 2015-05-08 13:06:03.049252065 +0300
@@ -27,7 +27,7 @@
Also exception 'error' is defined to allow capture of this module specific exceptions.
"""
-import socket,select,base64,dispatcher,sys
+import socket,ssl,select,base64,dispatcher,sys
from simplexml import ustr
from client import PlugIn
from protocol import *
@@ -312,9 +312,9 @@
""" Immidiatedly switch socket to TLS mode. Used internally."""
""" Here we should switch pending_data to hint mode."""
tcpsock=self._owner.Connection
- tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
- tcpsock._sslIssuer = tcpsock._sslObj.issuer()
- tcpsock._sslServer = tcpsock._sslObj.server()
+ tcpsock._sslObj = ssl.wrap_socket(tcpsock._sock, None, None)
+ tcpsock._sslIssuer = tcpsock._sslObj.getpeercert().get('issuer')
+ tcpsock._sslServer = tcpsock._sslObj.getpeercert().get('server')
tcpsock._recv = tcpsock._sslObj.read
tcpsock._send = tcpsock._sslObj.write