Fix (we are not using certificate but PEM private key file in this particular authentication; also, auxiliary cert_file is holding certificate chain that is ignored by python itself)

This commit is contained in:
Miroslav Stampar
2013-09-11 23:17:18 +02:00
parent 176f744ac6
commit a3defc175d
7 changed files with 30 additions and 222 deletions

22
lib/request/pkihandler.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import httplib
import urllib2
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)
def getConnection(self, host, timeout=None):
return httplib.HTTPSConnection(host, key_file=self.key_file, timeout=conf.timeout)