Mageia Bugzilla – Attachment 6169 Details for
Bug 15584
ajenti unable to log in (gevent/python 2.7.9 ssl issue)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch from upstream
file_15584.txt (text/plain), 1.41 KB, created by
Philippe Makowski
on 2015-04-01 00:11:27 CEST
(
hide
)
Description:
patch from upstream
Filename:
MIME Type:
Creator:
Philippe Makowski
Created:
2015-04-01 00:11:27 CEST
Size:
1.41 KB
patch
obsolete
>From 54442ccb2b9ee24af15500557e7dd7b2f58acb97 Mon Sep 17 00:00:00 2001 >From: Eugene Pankov <john.pankov@gmail.com> >Date: Sun, 21 Sep 2014 11:35:53 +0300 >Subject: [PATCH] truly fixed #578 > >--- > ajenti/compat.py | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > >diff --git a/ajenti/compat.py b/ajenti/compat.py >index ca5c330..c6c9f46 100644 >--- a/ajenti/compat.py >+++ b/ajenti/compat.py >@@ -90,3 +90,32 @@ def new_transport_init(self, *args, **kwargs): > > BaseTransport.__init__ = new_transport_init > >+ >+ >+# Re-add sslwrap to Python 2.7.9 >+import inspect >+__ssl__ = __import__('ssl') >+ >+try: >+ _ssl = __ssl__._ssl >+except AttributeError: >+ _ssl = __ssl__._ssl2 >+ >+ >+def new_sslwrap(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=__ssl__.CERT_NONE, ssl_version=__ssl__.PROTOCOL_SSLv23, ca_certs=None, ciphers=None): >+ context = __ssl__.SSLContext(ssl_version) >+ context.verify_mode = cert_reqs or __ssl__.CERT_NONE >+ if ca_certs: >+ context.load_verify_locations(ca_certs) >+ if certfile: >+ context.load_cert_chain(certfile, keyfile) >+ if ciphers: >+ print ciphers >+ context.set_ciphers(ciphers) >+ >+ caller_self = inspect.currentframe().f_back.f_locals['self'] >+ return context._wrap_socket(sock, server_side=server_side, ssl_sock=caller_self) >+ >+if not hasattr(_ssl, 'sslwrap'): >+ _ssl.sslwrap = new_sslwrap >+
From 54442ccb2b9ee24af15500557e7dd7b2f58acb97 Mon Sep 17 00:00:00 2001 From: Eugene Pankov <john.pankov@gmail.com> Date: Sun, 21 Sep 2014 11:35:53 +0300 Subject: [PATCH] truly fixed #578 --- ajenti/compat.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ajenti/compat.py b/ajenti/compat.py index ca5c330..c6c9f46 100644 --- a/ajenti/compat.py +++ b/ajenti/compat.py @@ -90,3 +90,32 @@ def new_transport_init(self, *args, **kwargs): BaseTransport.__init__ = new_transport_init + + +# Re-add sslwrap to Python 2.7.9 +import inspect +__ssl__ = __import__('ssl') + +try: + _ssl = __ssl__._ssl +except AttributeError: + _ssl = __ssl__._ssl2 + + +def new_sslwrap(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=__ssl__.CERT_NONE, ssl_version=__ssl__.PROTOCOL_SSLv23, ca_certs=None, ciphers=None): + context = __ssl__.SSLContext(ssl_version) + context.verify_mode = cert_reqs or __ssl__.CERT_NONE + if ca_certs: + context.load_verify_locations(ca_certs) + if certfile: + context.load_cert_chain(certfile, keyfile) + if ciphers: + print ciphers + context.set_ciphers(ciphers) + + caller_self = inspect.currentframe().f_back.f_locals['self'] + return context._wrap_socket(sock, server_side=server_side, ssl_sock=caller_self) + +if not hasattr(_ssl, 'sslwrap'): + _ssl.sslwrap = new_sslwrap +
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15584
: 6169