Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python27Packages.xmpppy: fix ssl socket api
- Loading branch information
Showing
3 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ stdenv, buildPythonPackage, fetchurl, isPy3k }: | ||
buildPythonPackage rec { | ||
name = "xmpp.py-${version}"; | ||
version = "0.5.0rc1"; | ||
|
||
patches = [ ./ssl.patch ]; | ||
|
||
src = fetchurl { | ||
url = "mirror://sourceforge/xmpppy/xmpppy-${version}.tar.gz"; | ||
sha256 = "16hbh8kwc5n4qw2rz1mrs8q17rh1zq9cdl05b1nc404n7idh56si"; | ||
}; | ||
|
||
preInstall = '' | ||
mkdir -p $out/bin $out/lib $out/share $(toPythonPath $out) | ||
export PYTHONPATH=$PYTHONPATH:$(toPythonPath $out) | ||
''; | ||
|
||
disabled = isPy3k; | ||
|
||
meta = with stdenv.lib; { | ||
description = "XMPP python library"; | ||
homepage = "http://xmpppy.sourceforge.net/"; | ||
license = license.gpl3; | ||
maintainers = [ maintainers.mic92 ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters