diff --git a/linkcheck/checker/httpsurl.py b/linkcheck/checker/httpsurl.py index 61f54c5a..806f48ea 100644 --- a/linkcheck/checker/httpsurl.py +++ b/linkcheck/checker/httpsurl.py @@ -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: