This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515from twisted .internet import ssl
16- from OpenSSL import SSL
17- from twisted .internet ._sslverify import _OpenSSLECCurve , _defaultCurveName
16+ from OpenSSL import SSL , crypto
17+ from twisted .internet ._sslverify import _defaultCurveName
1818
1919import logging
2020
@@ -32,8 +32,9 @@ def __init__(self, config):
3232 @staticmethod
3333 def configure_context (context , config ):
3434 try :
35- _ecCurve = _OpenSSLECCurve (_defaultCurveName )
36- _ecCurve .addECKeyToContext (context )
35+ _ecCurve = crypto .get_elliptic_curve (_defaultCurveName )
36+ context .set_tmp_ecdh (_ecCurve )
37+
3738 except Exception :
3839 logger .exception ("Failed to enable elliptic curve for TLS" )
3940 context .set_options (SSL .OP_NO_SSLv2 | SSL .OP_NO_SSLv3 )
Original file line number Diff line number Diff line change 3939 "signedjson>=1.0.0" : ["signedjson>=1.0.0" ],
4040 "pynacl>=1.2.1" : ["nacl>=1.2.1" , "nacl.bindings" ],
4141 "service_identity>=1.0.0" : ["service_identity>=1.0.0" ],
42+ "Twisted>=16.0.0" : ["twisted>=16.0.0" ],
4243
43- # we break under Twisted 18.4
44- # (https://github.com/matrix-org/synapse/issues/3135)
45- "Twisted>=16.0.0,<18.4" : ["twisted>=16.0.0" ],
44+ # We use crypto.get_elliptic_curve which is only supported in >=0.15
45+ "pyopenssl>=0.15" : ["OpenSSL>=0.15" ],
4646
47- "pyopenssl>=0.14" : ["OpenSSL>=0.14" ],
4847 "pyyaml" : ["yaml" ],
4948 "pyasn1" : ["pyasn1" ],
5049 "daemonize" : ["daemonize" ],
You can’t perform that action at this time.
0 commit comments