mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-22 04:34:28 +03:00
Don't laugh at my own jokes
This commit is contained in:
parent
983474d250
commit
1fd5680496
1 changed files with 4 additions and 4 deletions
|
@ -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():
|
||||||
|
|
Loading…
Reference in a new issue