Skip to content

Commit

Permalink
enable ECDHE ciphers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Haines committed Sep 1, 2014
1 parent 270d302 commit 79650f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/crypto/context_factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from twisted.internet import reactor, ssl
from OpenSSL import SSL
from twisted.internet._sslverify import _OpenSSLECCurve, _defaultCurveName


class ServerContextFactory(ssl.ContextFactory):
Expand All @@ -12,6 +13,11 @@ def __init__(self, config):

@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)
Expand Down

0 comments on commit 79650f7

Please sign in to comment.