- if need_HTTPSConnection:
- #conn = HTTPSConnection(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {}))
- conn = HTTPSConnection(host, None, key_file=self.key_file, cert_file=self.cert_file) #**(x509 or {}))
- else:
- #conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {}))
- conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file) #**(x509 or {}))
-
- if hasattr(conn, 'set_timeout'):
- conn.set_timeout(self.timeout)
+ conn = http_client.HTTPSConnection(host, None, key_file=self.key_file,
+ cert_file=self.cert_file,
+ **turn_off_server_verify)