Open ajgringo619 opened 1 year ago
Currently running my scripts using 3.10.5 and i dont have this issue, however, i did find this stackoverflow post in relation to this SSLV3_ALERT_HANDSHAKE_FAILURE
error.
Can you give this solution a try?
Thanks for the info. I'll give this a shot after the Morgan/Stanley merger is complete.
my turn with the short stick...everything working until 2023-06-22. Coincidental with upgrade from python 3.11.3 to 3.11.4.
HTTPSConnectionPool(host='api.etrade.com', port=443): Max retries exceeded with url: /oauth/request_token (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1002)')))
anyone else having trouble today?
I saw that ajgringo619 was having trouble with 3.11.3, so I'm skeptical it could be python versioning.
I confirmed that python 3.10 and 3.11 with their associated crypto libraries causes the problem. python3.9 and it's libraries do not experience the SSL problem. Next step is to document when libraries are involved in the oauth process for each version of python.
python 3.9, 3.10, and 3.11 all use the same library versions in my code, so I'm at a loss why python3.9 works while 3.10 and 3.11 do NOT.
pyetrade | 1.4.1 oauthlib | 3.2.2 requests_oauthlib | 1.3.1 requests | 2.31.0 xmltodict | 0.13.0 jxmlease | 1.0.3 certifi | 2023.5.7 urllib3 | 2.0.3
very interesting, again i dont have issues with python 3.10.5. My package version list is below (as outlined by @1rocketdude):
pyetrade | 1.4.1 oauthlib | 3.2.2 requests_oauthlib | 1.3.1 requests | 2.28.1 xmltodict | 0.13.0 jxmlease | 1.0.3 certifi | 2022.9.24 urllib3 | 1.26.12
Different version are highlighted in bold, it appears that i am still using some older packages for serving http requests.
I don't think its a python version issue, can you guys try downgrading your packages and test to see if it works? Its possible that one of these packages (or a combination of them) is causing the handshake error.
I guess trial and error to figure out which ones it might be.
Nvm, that didnt take long, its the urllib3 package.
i first upgraded the urllib3 package to the latest version and my script failed with the handshake error instantly. I upgraded all the other packages (except urllib3) and my script worked as normal but updating it as well broke it again.
Looking at their github, it looks like they went through some SSL changes from 1.26.16 to 2.0.3.
Something has definitely changed in regards to how they are handling SSL that the pyetrade oauth requests are not doing, my gut is telling me its got something to do with OpenSSL. I'm not entirely sure what the root cause is, don't have time to dive deeper at the moment.
confirmed. Thanks everyone for your investigative work. It is indeed the urllib3 package.
I downgrade to urllib3 1.26.16, which is the latest version of the 1.xx series. Now everything works with python 3.11.4.
I agree with Robert - no need to deep dive into why. Simply publicize that urllib3 2.x is the problem. Simple fix.
cheers, Tom
On Jun 29, 2023, at 10:46 AM, Robert @.***> wrote:
Nvm, that didnt take long its the urllib3 package.
i first upgraded the urllib3 package to the latest version and my script failed with the handshake error instantly. Looking at their github, it looks like they went through some SSL changes from 1.26.16 to 2.0.3.
Something has definitely changed in regards to how they are handling SSL that the pyetrade oauth requests are not doing. I'm not sure what it could be, don't have time to dive deeper at the moment.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
Currently running my scripts using 3.10.5 and i dont have this issue, however, i did find this stackoverflow post in relation to this
SSLV3_ALERT_HANDSHAKE_FAILURE
error.Can you give this solution a try?
Sorry I haven't got back to you. I'm still stuck on waiting for my consumer keys to be activated, been a month now.
Thank you. Can confirm that downgrading to urllib3 1.26.16 helped. I'm using Python 3.10
yes - downgrade to the latest 1.26 version - I think 1.26.18 and it magically works again.
python version doesn’t matter.
On Nov 21, 2023, at 10:29 PM, Nisar @.***> wrote:
Thank you. Can confirm that downgrading to urllib3 1.26.16 helped. I'm using Python 3.10
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
ERROR: Could not find a version that satisfies the requirement urllib==1.26.16 (from versions: none) and ERROR: Could not find a version that satisfies the requirement urllib==1.26.18 (from versions: none) both don't work for me
ERROR: Could not find a version that satisfies the requirement urllib==1.26.16 (from versions: none) and ERROR: Could not find a version that satisfies the requirement urllib==1.26.18 (from versions: none) both don't work for me
@Rohit9605 Its the urllib3 package (urllib3==1.26.18
) not urllib
So I took another look at this and it seems i was somehow able to get things to work intermittently but i would like others try and confirm if possible.
PYTHON_VERSION = 3.10
urllib3
to 2.2.1
(latest 2.x version)
pip install --upgrade urllib3
requests
to the latest version (2.32.2
)
pip install --upgrade requests
idna==3.7
certifi==2024.2.2
After doing the above, I tried running my test script (simple get_quote
call) a few times before i stopped getting SSL error (at least 5-10 times) and got the desired output.
I'm not sure if its something else related to my machine (i dont think I've changed anything else out of the ordinary) but the only other thing I've seen to check is your machines openssl
version, however, i definitely haven't touched that in a long time (for both of my windows and linux machines).
Its not working 100%, i still get the SSL error sometimes (quite frequently tbh), but either way, please try the above and report back here so we can narrow it down. Thank you.
I'm confirming that latest version of urllib3 (1.26.19) works fine with python 3.11.8. Upgrade to that version fixed my problem.
Getting the following SSLV3_ALERT_HANDSHAKE_FAILURE errors trying to run the sample code. This is happening with both consumer and sandbox keys:
After finding this thread - https://www.reddit.com/r/etrade/comments/1398aha/etrade_developer_api_fail/ - I am able to get it to work by downgrading to Python 3.9. Has anyone else experienced this?