We are living as nomad in Mexico !!

[curl] unable to get local issuer certificate (60)

You can see the following
  • Want to solve an error for unable to get local issuer certificate

Table of contents

What happened

> curl https://noknow.info
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

What causes

It would be the CA certificate validation error.


Method1: Disable certificate validation

You can execute curl command even if a server is insecure using "-k / --insecure" option.
If you are sure that the server is fine, this method would be good enough.

> curl -k https://noknow.info
> curl --insecure https://noknow.info

Method2: Specify CA certificate

Download the CA certificate the following URL.

Put the "cacert.pem" in the specified directory and then execute curl command with --cacert option.

Method3: Set CA certificate using environment variables

The environment variable is "CURL_CA_BUNDLE". So set the path of the CA certificate to the "CURL_CA_BUNDLE".

> export CURL_CA_BUNDLE=/usr/local/share/curl/cacert.pem
> curl https://noknow.info

🌟The author of this article is:🌟

Kakeru profile

Kakeru Sato

Software Developer

Full stack engineer