From 1d866351b900d4186a4599a43eda4b8e2198b8ee Mon Sep 17 00:00:00 2001 From: lethliel Date: Tue, 23 Jul 2019 17:37:12 +0200 Subject: [PATCH] fix oscssl.py not verifying TLS cert verification use own implementation of HTTPSConnection (myHTTPSConnection) instead the one provided by M2Crypto (httpslib.HTTPConnection) And in proxy case use myProxyHTTPSConnection. all credits go to wfrisch --- osc/oscssl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osc/oscssl.py b/osc/oscssl.py index 312c236e..32c548d0 100644 --- a/osc/oscssl.py +++ b/osc/oscssl.py @@ -199,13 +199,13 @@ class myHTTPSHandler(M2Crypto.m2urllib2.HTTPSHandler): if target_host != host: request_uri = urldefrag(full_url)[0] - h = httpslib.ProxyHTTPSConnection(host=host, ssl_context=self.ctx) + h = myProxyHTTPSConnection(host=host, ssl_context=self.ctx) else: try: # up to python-3.2 request_uri = req.get_selector() except AttributeError: # from python-3.3 request_uri = req.selector - h = httpslib.HTTPSConnection(host=host, ssl_context=self.ctx) + h = myHTTPSConnection(host=host, ssl_context=self.ctx) # End our change h.set_debuglevel(self._debuglevel)