-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLSV1_ALERT_ACCESS_DENIED error with aiohttp, works fine with httpx and requests #9475
Comments
Can not reproduce it.
edit: I noticed that you mentioned using python 3.12 with windows 7. As far as i know windows 7 is not supported for python 3.9+. Could you provide more information or try reproducing this on another platform? |
Yeah, Python 3.12 is not officially supported on Windows 7 but it works just fine. You just need an unlocked installer by adang1345. Anyway, I've tried with an official version of Python on another Win7x64 system. The result is the same. Versions
Output
Traceback
Please note that since both requests and httpx successfully retrieve the response from the server, the issue is with aiohttp. |
@JidGalaxio you should probably compare the difference between the |
Most of us do not have Windows to test on. Therefore, you'll need to do some more testing yourself and create a test in our CI which fails on Windows. Stackoverflow suggests something is wrong with openssl: Otherwise, try creating a different SSLContext as mentioned above. Maybe changing the minimum/maximum protocol versions allowed: |
I've already tried different SSLContext options. finally:
print(f"SSL Protocol Version, Min: {ssl_context.minimum_version}, Max: {ssl_context.maximum_version}")
|
ssl.OPENSSL_VERSION would probably also be useful to know. |
OpenSSL 3.0.13 30 Jan 2024 |
Describe the bug
I'm encountering an issue where both requests and httpx successfully retrieve the response from a server, but aiohttp raises a TLSV1_ALERT_ACCESS_DENIED error when attempting to connect to the same server over HTTPS.
Additionally, the URL opens without any issues in the Chrome browser and works perfectly with curl. I have also tried accessing the server using a VPN, so I'm pretty sure it's not related to the source IP address.
To Reproduce
Expected behavior
aiohttp should behave similarly to requests and httpx by successfully retrieving a response from the server.
Output:
[aiohttp] Error: Cannot connect to host dl2.vinafile.xyz:443 ssl:default [[SSL: TLSV1_ALERT_ACCESS_DENIED] tlsv1 alert access denied (_ssl.c:1000)]
[httpx] Status Code: 200
[requests] Status Code: 200
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
propcache Version
yarl Version
OS
Windows 7 x64
Related component
Client
Additional context
I've tried adjusting SSL contexts, enabling/disabling verification, and testing with different configurations, but the issue persists specifically with aiohttp.
Any insights or suggestions for resolving this issue would be appreciated!
Code of Conduct
The text was updated successfully, but these errors were encountered: