Skip to content
Snippets Groups Projects
Commit 79650f79 authored by Mark Haines's avatar Mark Haines
Browse files

enable ECDHE ciphers

parent 270d3028
No related branches found
No related tags found
No related merge requests found
from twisted.internet import reactor, ssl
from OpenSSL import SSL
from twisted.internet._sslverify import _OpenSSLECCurve, _defaultCurveName
class ServerContextFactory(ssl.ContextFactory):
......@@ -12,6 +13,11 @@ class ServerContextFactory(ssl.ContextFactory):
@staticmethod
def configure_context(context, config):
try:
_ecCurve = _OpenSSLECCurve(_defaultCurveName)
_ecCurve.addECKeyToContext(context)
except:
pass
context.set_options(SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3)
context.use_certificate(config.tls_certificate)
context.use_privatekey(config.tls_private_key)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment