Do not check SSl certificates on HTTPS -> HTTP redirects.

This commit is contained in:
Bastian Kleineidam 2012-08-10 19:43:57 +02:00
parent 451a520943
commit c74690a79a

View file

@ -44,9 +44,12 @@ class HttpsUrl (httpurl.HttpUrl):
return h
def check_ssl_certificate(self, ssl_sock, host):
"""Run all SSl certificate checks that have not yet been done.
"""Run all SSL certificate checks that have not yet been done.
OpenSSL already checked the SSL notBefore and notAfter dates.
"""
if not hasattr(ssl_sock, "getpeercert"):
# the URL was a HTTPS -> HTTP redirect
return
cert = ssl_sock.getpeercert()
log.debug(LOG_CHECK, "Got SSL certificate %s", cert)
if not cert: