Don't laugh at my own jokes

This commit is contained in:
Andrew Morgan 2019-04-03 10:51:43 +01:00
parent 983474d250
commit 1fd5680496

View file

@ -100,7 +100,7 @@ class TlsConfig(Config):
with open(ca_file, 'rb') as f: with open(ca_file, 'rb') as f:
content = f.read() content = f.read()
except Exception: except Exception:
logger.fatal("Failed to read custom CA certificate off disk!") logger.fatal("Failed to read custom CA certificate off disk")
raise raise
# Parse the CA certificates # Parse the CA certificates
@ -108,7 +108,7 @@ class TlsConfig(Config):
cert_base = Certificate.loadPEM(content) cert_base = Certificate.loadPEM(content)
certs.append(cert_base) certs.append(cert_base)
except Exception: except Exception:
logger.fatal("Failed to parse custom CA certificate off disk!") logger.fatal("Failed to parse custom CA certificate off disk")
raise raise
self.federation_custom_ca_list = trustRootFromCertificates(certs) self.federation_custom_ca_list = trustRootFromCertificates(certs)
@ -143,12 +143,12 @@ class TlsConfig(Config):
with open(self.tls_certificate_file, 'rb') as f: with open(self.tls_certificate_file, 'rb') as f:
cert_pem = f.read() cert_pem = f.read()
except Exception: except Exception:
logger.fatal("Failed to read existing certificate off disk!") logger.fatal("Failed to read existing certificate off disk")
try: try:
tls_certificate = crypto.load_certificate(crypto.FILETYPE_PEM, cert_pem) tls_certificate = crypto.load_certificate(crypto.FILETYPE_PEM, cert_pem)
except Exception: except Exception:
logger.fatal("Failed to parse existing certificate off disk!") logger.fatal("Failed to parse existing certificate off disk")
if not allow_self_signed: if not allow_self_signed:
if tls_certificate.get_subject() == tls_certificate.get_issuer(): if tls_certificate.get_subject() == tls_certificate.get_issuer():