-
-
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
ClientConnectorCertificateError raised when using aiohttp Client #5375
Comments
Judging by the first traceback, I'd say this was an issue in Python's ssl module, not something to do with aiohttp. So, I'd suggest looking for that error more generally. At a guess, it may be that the installation is missing some CA certificates or something similar. I recall similar issues in the past with MacOS generally, due to Apple having not updated the CA certs for a couple of years (so websites using newer CAs would end up failing). |
I checked the source code of |
Also, I tested with macOS built in Python and pyenv installed Python, they both work well, it must be something wrong with port installed Python , I have no idea about how to solve it. |
So may be it makes sense to convert this bug to a feature request for soft dependency for |
I've just encountered this myself on a Mac, after installing the 3.9.2 binary from python.org. |
So, I can run them explicitly. |
With old install:
With new install:
Clearly, installing the binary from python.org results in it being unable to find the system installed certificates. So, this is definetely not an issue with aiohttp, but with the Python installer. Not sure how to fix it yet though. |
@Dreamsorcerer the official DMGs come with a post-install script: It should be executed upon install: https://github.com/ansible/pylibssh/blob/fc51b62/.github/workflows/build-test-n-publish.yml#L247-L253. Ref: https://flaviocopes.com/python-installation-macos/. This will also manifest itself with the bundled P.S. It looks like @alviezhang didn't hit this TLS problem with |
@alviezhang You can either run the post-install script to set up the trust chain or use a custom |
Uhh, OK, this is what happens when you click through an installer without reading. The command mentioned by @webknjaz is not run automatically when installing with the python.org installer. The last step of the installer tells you that you should run the command yourself. |
I wanted to highlight the Issue Comment referenced in @webknjaz's comment as it was pretty helpful. It shows the steps to install the certificate. |
🐞 Describe the bug
Recently I moved from
homebrew
tomacports
for some reasons, I soon found that aiohttp cannot connect to https sites by using portspython-39
withpy39-aiohttp
, the same result as the pip installedaiohttp
.I tested with
requests
and it performed very well to connect https sites.What is wrong with macports and its builtin python package, how can I find out what is going wrong?
💡 To Reproduce
OS: macOS 10.15.7
macport: 2.6.4
port package installed:
python39
,py-aiohttp
Code to reproduce, the official document example
💡 Expected behavior
Successfully get the API response.
📋 Logs/tracebacks
📋 Your version of the Python
📋 Your version of the aiohttp/yarl/multidict distributions
📋 Additional context
Same environment but use
requests
orhttpx
module instead behaves normallyAnd I also tested them with self signed URL too, they both raise SSL error as expected.
The text was updated successfully, but these errors were encountered: