A spot of future proofing

This commit is contained in:
Kovid Goyal 2017-03-10 01:07:34 +05:30
parent 0f7b73d7c4
commit db6243dfff

View File

@ -22,8 +22,9 @@ class ModernHTTPSHandler(HTTPSHandler):
if cert_file: if cert_file:
self.ssl_context.load_cert_chain(cert_file, key_file) self.ssl_context.load_cert_chain(cert_file, key_file)
def conn_factory(hostport): def conn_factory(hostport, **kw):
return httplib.HTTPSConnection(hostport, context=self.ssl_context) kw['context'] = self.ssl_context
return httplib.HTTPSConnection(hostport, **kw)
return self.do_open(conn_factory, req) return self.do_open(conn_factory, req)