Clean up many warnings

This commit is contained in:
Erica Portnoy
2018-11-01 16:39:54 -07:00
parent 49619fc0ab
commit 36e8d748a1
10 changed files with 41 additions and 17 deletions
+3 -1
View File
@@ -276,8 +276,10 @@ def _avoid_invalidating_lineage(config, lineage, original_server):
"Do not renew a valid cert with one from a staging server!"
# Some lineages may have begun with --staging, but then had production certs
# added to them
with open(lineage.cert) as the_file:
contents = the_file.read()
latest_cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, open(lineage.cert).read())
OpenSSL.crypto.FILETYPE_PEM, contents)
# all our test certs are from happy hacker fake CA, though maybe one day
# we should test more methodically
now_valid = "fake" not in repr(latest_cert.get_issuer()).lower()