diff --git a/modules/bnporc/browser.py b/modules/bnporc/browser.py index 7fe17c0b..2974e137 100644 --- a/modules/bnporc/browser.py +++ b/modules/bnporc/browser.py @@ -37,7 +37,7 @@ __all__ = ['BNPorc'] class BNPorc(BaseBrowser): DOMAIN = 'www.secure.bnpparibas.net' PROTOCOL = 'https' - CERTHASH = 'f7dae8d9e0f2c63a1c35d8cf1a86fdd5441a897340538b045ba8197f40c28cad' + CERTHASH = ['f7dae8d9e0f2c63a1c35d8cf1a86fdd5441a897340538b045ba8197f40c28cad', '5511f0ff19c982b6351c17b901bfa7419f075edb13f2df41e446248beb7866bb'] ENCODING = None # refer to the HTML encoding PAGES = {'.*pageId=unedescomptes.*': AccountsList, '.*pageId=releveoperations.*': AccountHistory, diff --git a/weboob/tools/browser/browser.py b/weboob/tools/browser/browser.py index 402bca26..29f1578c 100644 --- a/weboob/tools/browser/browser.py +++ b/weboob/tools/browser/browser.py @@ -403,12 +403,14 @@ class StandardBrowser(mechanize.Browser): except ControlNotFoundError: return - def lowsslcheck(self, domain, hash): + def lowsslcheck(self, domain, hsh): certs = ssl.get_server_certificate((domain, 443)) certhash = hashlib.sha256(certs).hexdigest() if self.logger: - self.logger.debug('Found %s as certificat hash' % certhash) - if certhash != hash: + self.logger.debug('Found %s as certificate hash' % certhash) + if isinstance(hsh, basestring): + hsh = [hsh] + if certhash not in hsh: raise ssl.SSLError()