hardcode the value of OpenSSL.SSL.OP_NO_TICKET for old version of openssl. Fixes #5689
This commit is contained in:
parent
d10322d48b
commit
04418850f9
1 changed files with 7 additions and 2 deletions
|
@ -384,8 +384,13 @@ class NonBlockingTLS(PlugIn):
|
||||||
else:
|
else:
|
||||||
# See http://docs.python.org/dev/library/ssl.html
|
# See http://docs.python.org/dev/library/ssl.html
|
||||||
tcpsock._sslContext = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
|
tcpsock._sslContext = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
|
||||||
tcpsock._sslContext.set_options(OpenSSL.SSL.OP_NO_SSLv2 | \
|
flags = OpenSSL.SSL.OP_NO_SSLv2
|
||||||
OpenSSL.SSL.OP_NO_TICKET)
|
try:
|
||||||
|
flags |= OpenSSL.SSL.OP_NO_TICKET
|
||||||
|
except AttributeError, e:
|
||||||
|
# py-OpenSSL < 0.9 or old OpenSSL
|
||||||
|
flags |= 16384
|
||||||
|
tcpsock._sslContext.set_options(flags)
|
||||||
|
|
||||||
tcpsock.ssl_errnum = 0
|
tcpsock.ssl_errnum = 0
|
||||||
tcpsock._sslContext.set_verify(OpenSSL.SSL.VERIFY_PEER,
|
tcpsock._sslContext.set_verify(OpenSSL.SSL.VERIFY_PEER,
|
||||||
|
|
Loading…
Add table
Reference in a new issue