SSLError: EOF occurred in violation of protocol (_ssl.c:581)
chrismv48 opened this issue · comments
I get this error both when using the library to make API calls and when using the requests library directly: SSLError: EOF occurred in violation of protocol (_ssl.c:581)
I am able to get a 200 response via curl and also when using the production api endpoint.
Nevermind, I googled around and it looks like installing a few additional packages will resolve this issue (although I don't understand what the core issue is). pip install pyopenssl pyasn1 ndg-httpsclient
This issue appears to be related to this:
https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/contrib/pyopenssl.py
This specifies that in order to support SNI (and to use TLSv1.1 or greater) in Python 2.7.x using the requests library, you'll need to install the following dependencies:
pip install pyopenssl ndg-httpsclient pyasn1
That said, installing the above dependencies is a valid work around.
Re-closing, also now documented at https://github.com/plaid/plaid-python#known-issues.
Thanks @silverp1 @chrismv48
In case this helps others, I finally learned about this issue after receiving the following error:
ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))
Installing ndg-httpsclient
and pyasn1
helped me.
pip install ndg-httpsclient pyasn1
The fix for this is to update Plaid's dependencies to install those bits appropriately:
install_requires['requests>=2.7.0']
=> install_requires=['requests[security]>=2.7.0']
as requests declares this dependency
This is a relatively little-known dependency feature.