Skip to content

Commit

Permalink
Add log message if we can't enable ECC. Require pyopenssl>=0.14 since…
Browse files Browse the repository at this point in the history
… 0.13 doesn't seem to have ECC
  • Loading branch information
Mark Haines committed Oct 24, 2014
1 parent db2e350 commit 15be181
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def read(fname):
"syutil==0.0.2",
"Twisted>=14.0.0",
"service_identity>=1.0.0",
"pyopenssl>=0.14",
"pyyaml",
"pyasn1",
"pynacl",
Expand Down
5 changes: 4 additions & 1 deletion synapse/crypto/context_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from OpenSSL import SSL
from twisted.internet._sslverify import _OpenSSLECCurve, _defaultCurveName

import logging

logger = logging.getLogger(__name__)

class ServerContextFactory(ssl.ContextFactory):
"""Factory for PyOpenSSL SSL contexts that are used to handle incoming
Expand All @@ -31,7 +34,7 @@ def configure_context(context, config):
_ecCurve = _OpenSSLECCurve(_defaultCurveName)
_ecCurve.addECKeyToContext(context)
except:
pass
logger.exception("Failed to enable eliptic curve for TLS")
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 15be181

Please sign in to comment.