Following error occurs only with docker app in python when making request to an https url.
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>
Outside of docker, the app works. I can fetch the same URL inside the docker image of other language app such as dotnet.
I have tried:
RUN update-ca-certificates- Install
certfilibrary and manually supply the certificates during making the call - Manually insert the certificates that comes with
certifylibrary in different locations of docker images such as/usr/local/share/ca-certificates/,/etc/ssl/certs/andRUN update-ca-certificates - Tried different versions (
3.6.9,3.8.4) and providers (alpine,buster,slim-buster) of python. - Setting different env variables such as
REQUESTS_CA_BUNDLE,SSL_CERT_FILEetc. - Use different libraries such as
requests,urllib,urllib3
.... and really large number of different things.
It of course works when I turn the verify off, but I want to keep verification.