fix certificate check
This commit is contained in:
parent
d2e477123f
commit
3ea8494e80
1 changed files with 4 additions and 1 deletions
|
|
@ -175,6 +175,8 @@ class StandardBrowser(mechanize.Browser):
|
||||||
responses_dirname = None
|
responses_dirname = None
|
||||||
responses_count = 0
|
responses_count = 0
|
||||||
|
|
||||||
|
logger = None
|
||||||
|
|
||||||
# ------ Browser methods ---------------------------------------
|
# ------ Browser methods ---------------------------------------
|
||||||
|
|
||||||
# I'm not a robot, so disable the check of permissions in robots.txt.
|
# I'm not a robot, so disable the check of permissions in robots.txt.
|
||||||
|
|
@ -402,7 +404,8 @@ class StandardBrowser(mechanize.Browser):
|
||||||
def lowsslcheck(self, domain, hash):
|
def lowsslcheck(self, domain, hash):
|
||||||
certs = ssl.get_server_certificate((domain, 443))
|
certs = ssl.get_server_certificate((domain, 443))
|
||||||
certhash = hashlib.sha256(certs).hexdigest()
|
certhash = hashlib.sha256(certs).hexdigest()
|
||||||
self.logger.debug('Found %s as certificat hash' % certhash)
|
if self.logger:
|
||||||
|
self.logger.debug('Found %s as certificat hash' % certhash)
|
||||||
if certhash != hash:
|
if certhash != hash:
|
||||||
raise ssl.SSLError()
|
raise ssl.SSLError()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue