send SNI for federation requests

This commit is contained in:
Jeroen 2018-06-24 22:38:43 +02:00
parent 1d009013b3
commit 3d605853c8
15 changed files with 71 additions and 13 deletions

View file

@ -47,6 +47,8 @@ class TlsConfig(Config):
self.tls_fingerprints = config["tls_fingerprints"]
self.tls_ignore_certificate_validation = config.get("tls_ignore_certificate_validation", False)
# Check that our own certificate is included in the list of fingerprints
# and include it if it is not.
x509_certificate_bytes = crypto.dump_certificate(
@ -73,6 +75,8 @@ class TlsConfig(Config):
tls_private_key_path = base_key_name + ".tls.key"
tls_dh_params_path = base_key_name + ".tls.dh"
tls_ignore_certificate_validation = False
return """\
# PEM encoded X509 certificate for TLS.
# You can replace the self-signed certificate that synapse
@ -117,6 +121,11 @@ class TlsConfig(Config):
#
tls_fingerprints: []
# tls_fingerprints: [{"sha256": "<base64_encoded_sha256_fingerprint>"}]
# Ignore certificate validation for TLS client connections to other
# homeservers using federation. Don't enable this in a production
# environment, unless you know what you are doing!
tls_ignore_certificate_validation: %(tls_ignore_certificate_validation)s
""" % locals()
def read_tls_certificate(self, cert_path):