Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge commit 'de6f89206' into anoa/dinsic_release_1_21_x
Browse files Browse the repository at this point in the history
* commit 'de6f89206':
  Add a comment about SSLv23_METHOD (#8043)
  • Loading branch information
anoadragon453 committed Oct 19, 2020
2 parents 5ede106 + de6f892 commit 152c6b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/8043.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a comment to `ServerContextFactory` about the use of `SSLv23_METHOD`.
8 changes: 8 additions & 0 deletions synapse/crypto/context_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class ServerContextFactory(ContextFactory):
connections."""

def __init__(self, config):
# TODO: once pyOpenSSL exposes TLS_METHOD and SSL_CTX_set_min_proto_version,
# switch to those (see https://github.com/pyca/cryptography/issues/5379).
#
# note that, despite the confusing name, SSLv23_METHOD does *not* enforce SSLv2
# or v3, but is a synonym for TLS_METHOD, which allows the client and server
# to negotiate an appropriate version of TLS constrained by the version options
# set with context.set_options.
#
self._context = SSL.Context(SSL.SSLv23_METHOD)
self.configure_context(self._context, config)

Expand Down

0 comments on commit 152c6b2

Please sign in to comment.