sqlmap/lib/request/pkihandler.py

23 lines
594 B
Python
Raw Normal View History

#!/usr/bin/env python
"""
2014-01-13 21:24:49 +04:00
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
2010-10-15 03:18:29 +04:00
See the file 'doc/COPYING' for copying permission
"""
import httplib
import urllib2
2010-01-07 15:59:09 +03:00
from lib.core.data import conf
class HTTPSPKIAuthHandler(urllib2.HTTPSHandler):
def __init__(self, key_file):
urllib2.HTTPSHandler.__init__(self)
self.key_file = key_file
def https_open(self, req):
return self.do_open(self.getConnection, req)
2013-02-05 15:16:06 +04:00
def getConnection(self, host, timeout=None):
return httplib.HTTPSConnection(host, key_file=self.key_file, timeout=conf.timeout)