Commit 4fcc98be authored by Mike Hibler's avatar Mike Hibler

Work around bug in m2crypto 0.25.1 til they fix it.

parent e9439e17
......@@ -17,4 +17,7 @@ PKGORIGIN= misc/emulab-py-m2crypto
.if ${PORTVERSION} == "0.25.1"
# Missing dependency for 0.25 (and beyond?)
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}typing>0:${PORTSDIR}/devel/py-typing
# Fix bug in 0.25.1
EXTRA_PATCHES+= $(FILESDIR)/emulab-patch-httpslib
.endif
--- M2Crypto/httpslib.py.orig 2016-07-25 09:05:21.000000000 -0600
+++ M2Crypto/httpslib.py 2017-03-16 10:22:30.351094000 -0600
@@ -121,6 +121,20 @@
self.session = session
+class HTTPS(HTTP):
+
+ _connection_class = HTTPSConnection
+
+ def __init__(self, host='', port=None, strict=None, **ssl):
+ HTTP.__init__(self, host, port, strict)
+ try:
+ self.ssl_ctx = ssl['ssl_context']
+ except KeyError:
+ self.ssl_ctx = SSL.Context('sslv23')
+ assert isinstance(self._conn, HTTPSConnection)
+ self._conn.ssl_ctx = self.ssl_ctx
+
+
class ProxyHTTPSConnection(HTTPSConnection):
"""
An HTTPS Connection that uses a proxy and the CONNECT request.
diff -ru M2Crypto-0.25.1.orig/M2Crypto/m2xmlrpclib.py M2Crypto-0.25.1/M2Crypto/m2xmlrpclib.py
--- M2Crypto/m2xmlrpclib.py.orig 2016-07-22 03:14:05.000000000 -0600
+++ M2Crypto/m2xmlrpclib.py 2017-03-16 10:23:47.153660000 -0600
@@ -40,8 +40,7 @@
# Handle username and password.
user_passwd, host_port = m2urllib.splituser(host)
_host, _port = m2urllib.splitport(host_port)
- h = httpslib.HTTPSConnection(_host, int(_port),
- ssl_context=self.ssl_ctx)
+ h = httpslib.HTTPS(_host, int(_port), ssl_context=self.ssl_ctx)
if verbose:
h.set_debuglevel(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment