| 1381 | if hasattr(http.client, 'HTTPSConnection'): |
| 1382 | |
| 1383 | class HTTPSHandler(AbstractHTTPHandler): |
| 1384 | |
| 1385 | def __init__(self, debuglevel=0, context=None, check_hostname=None): |
| 1386 | AbstractHTTPHandler.__init__(self, debuglevel) |
| 1387 | self._context = context |
| 1388 | self._check_hostname = check_hostname |
| 1389 | |
| 1390 | def https_open(self, req): |
| 1391 | return self.do_open(http.client.HTTPSConnection, req, |
| 1392 | context=self._context, check_hostname=self._check_hostname) |
| 1393 | |
| 1394 | https_request = AbstractHTTPHandler.do_request_ |
| 1395 | |
| 1396 | __all__.append('HTTPSHandler') |
| 1397 | |