Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6277212

Browse files
committed
Bug fix for HTTPSCertAuthHandler
1 parent c0888e9 commit 6277212

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

lib/request/certhandler.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import httplib
99
import urllib2
10-
import sys
1110

1211
from lib.core.data import conf
1312

@@ -20,9 +19,5 @@ def __init__(self, key_file, cert_file):
2019
def https_open(self, req):
2120
return self.do_open(self.getConnection, req)
2221

23-
def getConnection(self, host):
24-
if sys.version_info >= (2, 6):
25-
retVal = httplib.HTTPSConnection(host, key_file=self.key_file, cert_file=self.cert_file, timeout=conf.timeout)
26-
else:
27-
retVal = httplib.HTTPSConnection(host, key_file=self.key_file, cert_file=self.cert_file)
28-
return retVal
22+
def getConnection(self, host, timeout=None):
23+
return httplib.HTTPSConnection(host, key_file=self.key_file, cert_file=self.cert_file, timeout=conf.timeout)

0 commit comments

Comments
 (0)