- if need_HTTPSConnection:
- if not ssl_needs_unverified_context:
- conn = HTTPSConnection(host, None, key_file = self.key_file,
- cert_file = self.cert_file)
- else:
- conn = HTTPSConnection(host, None, key_file = self.key_file,
- cert_file = self.cert_file,
- context = ssl._create_unverified_context())
- else:
- conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file)
+ conn = http_client.HTTPSConnection(host, None, key_file=self.key_file,
+ cert_file=self.cert_file,
+ **turn_off_server_verify)