new stuff

This commit is contained in:
Jeffrey Paul
2013-03-11 23:22:36 +01:00
parent 3638f91be4
commit a3d1ba6310
3 changed files with 87 additions and 2 deletions

View File

@@ -103,9 +103,17 @@ class Website(object):
raise ReachabilityProblem("can't access: '%s'" % self.urlstring())
if self.is_tls():
self._get_cert()
if self.cert.expiresSoon() or not self.cert.validTime():
if not self.cert.validTime():
raise CertificateProblem(
"cert for %s is invalid or expires soon: %s" % (
"cert for %s is invalid: %s to %s" % (
self.urlstring(),
self.cert.notBefore(),
self.cert.notAfter()
)
)
if self.cert.expiresSoon():
raise CertificateProblem(
"cert for %s expires soon: %s" % (
self.urlstring(),
self.cert.notAfter()
)