From 93a10471fd19e79b977b7655acac2fac9bd5e5fe Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 1 Apr 2016 10:30:16 +0200 Subject: [PATCH] httplib has gone too --- sfa/client/sfaserverproxy.py | 9 ++++----- sfa/util/py23.py | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sfa/client/sfaserverproxy.py b/sfa/client/sfaserverproxy.py index 48bf4531..e281f66d 100644 --- a/sfa/client/sfaserverproxy.py +++ b/sfa/client/sfaserverproxy.py @@ -5,9 +5,8 @@ import ssl try: turn_off_server_verify = { 'context' : ssl._create_unverified_context() } except: turn_off_server_verify = {} -from httplib import HTTPS, HTTPSConnection - from sfa.util.py23 import xmlrpc_client +from sfa.util.py23 import http_client try: from sfa.util.sfalogging import logger @@ -50,9 +49,9 @@ class XMLRPCTransport(xmlrpc_client.Transport): # create a HTTPS connection object from a host descriptor # host may be a string, or a (host, x509-dict) tuple host, extra_headers, x509 = self.get_host_info(host) - conn = HTTPSConnection(host, None, key_file = self.key_file, - cert_file = self.cert_file, - **turn_off_server_verify) + conn = http_client.HTTPSConnection(host, None, key_file = self.key_file, + cert_file = self.cert_file, + **turn_off_server_verify) # Some logic to deal with timeouts. It appears that some (or all) versions # of python don't set the timeout after the socket is created. We'll do it diff --git a/sfa/util/py23.py b/sfa/util/py23.py index e581e7f9..c1a0ec80 100644 --- a/sfa/util/py23.py +++ b/sfa/util/py23.py @@ -14,6 +14,11 @@ try: except: from xmlrpc import client as xmlrpc_client +try: + import httplib as http_client +except: + from http import client as http_client + try: import ConfigParser except: -- 2.43.0