mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-12-03 23:13:53 +03:00
13 lines
452 B
Python
13 lines
452 B
Python
|
import httplib
|
||
|
import urllib2
|
||
|
|
||
|
class HTTPSCertAuthHandler(urllib2.HTTPSHandler):
|
||
|
def __init__(self, key_file, cert_file):
|
||
|
urllib2.HTTPSHandler.__init__(self)
|
||
|
self.key_file = key_file
|
||
|
self.cert_file = cert_file
|
||
|
def https_open(self, req):
|
||
|
return self.do_open(self.getConnection, req)
|
||
|
def getConnection(self, host):
|
||
|
return httplib.HTTPSConnection(host, key_file=self.key_file, cert_file=self.cert_file)
|