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

Commit

Permalink
Add a comment about SSLv23_METHOD (#8043)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored Aug 7, 2020
1 parent 2f9fd5a commit de6f892
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 de6f892

Please sign in to comment.