You want to make a https request to an URL that has a self-signed certificate,
and you’re using the requests
library on your python code. By default, it
will refuse to do that.
To fix this problem, first you have to add the certificate to your SO (if you
are on a container, add it at some point on the Dockerfile). If you are on
Ubuntu e.g.:
$ apt-get install -y --no-install-recommends ca-certificates openssl
crt
file to the
ca-certificates store:$ cp custom.crt /usr/local/share/ca-certificates
$ update-ca-certificates
$ curl https://my-custom-domain.com
IMPORTANT: it should work now, do NOT use -k
. If you use it, you are
bypassing the ssl verification anyway.
5) If you are using e.g. requests on python to make your request, you must use
the parameter verify
, passing the full path to the custom certificate. E.g.:
requests.get('https://my-custom-domain.com', verify='/usr/local/share/ca-certificates/custom.crt')