Browse files

new_ctx: if auto_ecdh=True, ctx.set_ecdh_auto to 1

Further helps with issue #81.
  • Loading branch information...
1 parent 93783e2 commit 9e4c1d80a084d65b2fe937cdabc0d9a367d2c1a4 @samrushing samrushing committed Mar 23, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 coro/ssl/__init__.py
View
4 coro/ssl/__init__.py
@@ -15,7 +15,7 @@
from openssl import x509, pkey, dh_param
-def new_ctx (cert=None, chain=(), key=None, proto=None, ciphers=None, dhparam=None, next_protos=None):
+def new_ctx (cert=None, chain=(), key=None, proto=None, ciphers=None, dhparam=None, next_protos=None, auto_ecdh=True):
ctx = openssl.ssl_ctx()
if cert:
ctx.use_cert (cert, chain)
@@ -29,6 +29,8 @@ def new_ctx (cert=None, chain=(), key=None, proto=None, ciphers=None, dhparam=No
ctx.set_tmp_dh (dhparam)
if next_protos:
ctx.set_next_protos (next_protos)
+ if auto_ecdh:
+ ctx.set_ecdh_auto (1)
return ctx
class sock (coro.sock):

0 comments on commit 9e4c1d8

Please sign in to comment.