Reputation: 8288
I'm trying to install pyOpenSSL using pip, python version is 2.7, OS is linux. After pyOpenSSL installed, when I tried to import the module in python, I got the following error:
Python 2.7.5 (default, Jun 27 2013, 03:17:39)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 84, in <module>
OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
AttributeError: 'FFILibrary' object has no attribute 'SSL_OP_NO_TICKET'
>>>
I tried to uninstall pyOpenSSL and install it again, but got the same error.
Upvotes: 0
Views: 3570
Reputation: 713
The fix is described here: https://github.com/pyca/pyopenssl/issues/130
Indeed, you can apply it manually (not really recommended, but easy) Or download archive from github The link to the fix: https://github.com/pyca/pyopenssl/commit/e7a6939a22a4290fff7aafe39dd0db85157d5e05
And the fix applied to SSL.py
-OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
+try:
+ OP_NO_TICKET = _lib.SSL_OP_NO_TICKET
+except AttributeError:
+ pass
Upvotes: 0
Reputation: 46
This is because low version pyopenssl has not defined SSL_OP_NO_TICKET。 clone the latest pyopenssl from https://github.com/pyca/pyopenssl.git and install it, then that'll be fine. no thks.
Upvotes: 3