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

Add a comment about SSLv23_METHOD #8043

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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