cURL certificate file location

Connecting to HTTPS servers with cURL or other such libraries requires cURL knowing the location of system certificates. If cURL doesn’t know the certificates location, accessing HTTPS URLs may fail with:

curl: (77) error setting certificate verify locations: curl can't find your certificates.

Fix this problem by setting environment variable SSL_CERT_FILE to the location of the system certificates. Example file locations include:

  • /etc/ssl/certs/ca-certificates.crt
  • /etc/pki/tls/certs/ca-bundle.crt

If on Linux, for example in ~/.profile add:

export SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt

or wherever the certificate files are.