diff options
author | Tom Ritter <tom@ritter.vg> | 2020-09-07 23:54:47 -0400 |
---|---|---|
committer | Tom Ritter <tom@ritter.vg> | 2020-09-07 23:54:47 -0400 |
commit | 7deaed5205d0db6139f1c5e1f7c2b72181b1a208 (patch) | |
tree | a9f11fe72bf4b20d787bd90bbcb7a78902dac1ae /jobs/TLSCertExpiration.py | |
parent | 4671e0dec5eab28941e598f109dbf77ed551a707 (diff) |
Run futurize on the codebase for python3
Diffstat (limited to 'jobs/TLSCertExpiration.py')
-rwxr-xr-x | jobs/TLSCertExpiration.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/jobs/TLSCertExpiration.py b/jobs/TLSCertExpiration.py index e4b05b7..e0fb689 100755 --- a/jobs/TLSCertExpiration.py +++ b/jobs/TLSCertExpiration.py @@ -1,14 +1,18 @@ #!/usr/bin/env python +from __future__ import absolute_import +from future import standard_library +standard_library.install_aliases() +from builtins import str import ssl import time import logging -import httplib +import http.client import OpenSSL import datetime -import JobBase -import JobSpawner +from . import JobBase +from . import JobSpawner class TLSCertExpiration(JobSpawner.JobSpawner): servers = [ @@ -35,7 +39,7 @@ class TLSCertExpiration(JobSpawner.JobSpawner): def execute(self): try: context = ssl._create_unverified_context() - c = httplib.HTTPSConnection(self.url, context=context) + c = http.client.HTTPSConnection(self.url, context=context) c.request("GET", "/") asn1 = c.sock.getpeercert(True) x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, asn1) |