talkpython / async-techniques-python-course

Async Techniques and Examples in Python Course
https://training.talkpython.fm/courses/explore_async_python/async-in-python-with-threading-and-multiprocessing
MIT License
451 stars 249 forks source link

aiohttp SSLCertVerificationError on Macbook #10

Closed sgreszcz closed 4 years ago

sgreszcz commented 4 years ago

Hi Michael,

Getting aiohttp errors when executing the async version of the web scraper for your site. Running OSX Catalina and (official) Python 3.8.1.


 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/aiohttp/connector.py", line 938, in _wrap_create_connection
    raise ClientConnectorCertificateError(
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host talkpython.fm:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')]
mikeckennedy commented 4 years ago

This is a weird error that has nothing to do with the internet or your app or the library. Some odd intermdiate certs for Python need setup that don't always get installed.

For the version of Python 3 you have (3.7? 3.8?), do this:

This should solve it.