diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2013-03-20 16:43:38 -0700 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2013-03-20 16:43:38 -0700 |
commit | 6315787f66f49ed2f0cf67c8fe5d549d850f2606 (patch) | |
tree | db9ea27ea985281b4697cb815494fdc3ad259aff | |
parent | d899af0ab4abde552fdca22c8b1401edd1a24446 (diff) | |
download | pyopenssl-6315787f66f49ed2f0cf67c8fe5d549d850f2606.tar.gz |
Use the new optional-sslv2 features of opentls
-rw-r--r-- | OpenSSL/SSL.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py index e4116e2..4d88d7b 100644 --- a/OpenSSL/SSL.py +++ b/OpenSSL/SSL.py @@ -203,13 +203,14 @@ class Context(object): new SSL connections. """ _methods = { - # TODO - # SSLv2_METHOD: _api.SSLv2_method, SSLv3_METHOD: _api.SSLv3_method, TLSv1_METHOD: _api.TLSv1_method, SSLv23_METHOD: _api.SSLv23_method, } + if not _api.PYOPENSSL_NO_SSL2: + _methods[SSLv2_METHOD] = _api.SSLv2_method + def __init__(self, method): """ :param method: One of SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, or @@ -224,6 +225,9 @@ class Context(object): raise ValueError("No such protocol") method_obj = method_func() + if method_obj == _api.NULL: + # XXX TODO what :( + 1/0 context = _api.SSL_CTX_new(method_obj) if context == _api.NULL: |