Closed adukic closed 7 years ago
I am getting this error AttributeError: 'NoneType' object has no attribute 'SSL_ERROR_WANT_READ' at "hyper/http20/connection.py" while using Python 2.7. I can see a hyper/compat.py where we are finding the versions and using ssl or ssl_compat. I dont know y its not working. Whenever I am deploying the project, server crashes with the above error. Can you please suggest some work around for it ?
Which specific version of 2.7 are you using? SSL issues are very likely to be caused by using older interpreter revisions. In 2.7.9+ there were major improvements applied to the SSL library, so you should consider upgrading.
We're also running PyAPNs2 on Python 2.7 without a problem.
PyAPNs2 requires Python to be compiled with OpenSSL 1.0.2 or greater for ALPN support in hyper. You can check the OpenSSL version on your server using:
import ssl
print ssl.OPENSSL_VERSION_INFO
print ssl._OPENSSL_API_VERSION
Both versions should be 1.0.2 or greater. If you install the latest Python for your platform, you will probably get a compatible version, but sometimes you'll have to compile your own Python or OpenSSL. If you're running on Heroku, see this note.
@adukic Are you by any chance deploying using gevent? Gevent monkey patches the SSLSocket implementation. I've had problems with gevent and APNS in the past.
It should be working fine with Python 2.7 as it is. I'm using PyAPNs2 with Py2.7 in production.
In case you have any specific problem with Python 2 and this library, please provide additional info.