-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Share an SSL context object between SSL connections #5417
Conversation
This involves changing how the info callbacks work.
turns out we need a shiny version of service_identity to enforce this correctly.
Add some tests for bad certificates for federation and .well-known connections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks sane?
synapse/crypto/context_factory.py
Outdated
# ... and we also gut-wrench a 'tls_verifier' attribute into the | ||
# tls_protocol so that the SSL context's info callback has something to | ||
# call to do the cert verification. | ||
setattr(tls_protocol, "tls_verifier", self._verifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Twisted code it looks somewhat like nothing else actually uses the app data, so I wonder if we can avoid the gut wrenching here.
But since we are gut wrenching can we name space this so that we don't accidentally collide with a param in twisted, e.g. _synapse_tls_verifier
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Twisted code it looks somewhat like nothing else actually uses the app data, so I wonder if we can avoid the gut wrenching here.
that didn't seem like an assumption I particularly wanted to make.
But since we are gut wrenching can we name space this so that we don't accidentally collide with a param in twisted, e.g. _synapse_tls_verifier?
fair
This has fixed: #5395 |
Hopefully fixes massive memory use with
federation_verify_certificates: true
,by sharing a couple of openssl context objects between all connections.
This involves changing how the info callbacks work and is generally a bit of a
rewrite of the context_factory stuff.
Also fixes a bug where connections to IP literal homeservers would always fail.