archipelproject / xmpppy Goto Github PK
View Code? Open in Web Editor NEWThis project forked from xmpppy/xmpppy
python-xmpp library
This project forked from xmpppy/xmpppy
python-xmpp library
Just thanks :-).
On Debian based distribution with libpython2.7-stdlib >= 2.7.8-10 socket.ssl seems to be broken/deprecated.
Failed with error :
File "/opt/Archipel-nighties/ArchipelAgent/archipel-core/archipelcore/xmpp/transports.py", line 360, in _startSSL
tcpsock._sslIssuer = tcpsock._sslObj.issuer()
AttributeError: '_ssl._SSLSocket' object has no attribute 'issuer'
The easy workaround is to use ssl.wrap_socket instead.
diff --git a/transports.py b/transports.py
index 6312a0d..2563e1a 100644
--- a/transports.py
+++ b/transports.py
@@ -27,7 +27,7 @@ Transports are stackable so you - f.e. TLS use HTPPROXYsocket or TCPsocket as mo
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 *
@@ -356,9 +356,9 @@ class TLS(PlugIn):
""" 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
Tested on ubuntu 14.10 with libpython2.7-stdlib version 2.7.8-10ubuntu1
Hi. I'm using your fork for a bug-fix that isn't in norman/xmpppy, for www.github.com/liavkoren/feedbot. I know it can be a major PITA to package something up, but do you have any plans for a release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.