Question

curl not working SSL

Posted March 23, 2020 924 views
Security

Hi,

I am trying to check an API with curl command and I am getting the below;

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.

I tried to install the cacert.pam as stated by the webpage above however no luck. Is there anything else I can do to fix this issue?

thank you
Stavros

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @stavroschrysanthou,

You can add the -k switch/attribute somewhere before the url. For example

curl -k https://example.com/path/to/url

Please note you’ll need to replace https://example.com/path/to/url with the actual URL you want to access. If you need more information, you can check the manual for curl

man curl

If you get to the -k attribute you’ll see something like


-k, --insecure (TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.

The server connection is verified by making sure the server's certificate contains the right name and verifies successfully using the cert store.

See this online resource for further details: https://curl.haxx.se/docs/sslcerts.html

You can also the –proxy-insecure and –cacert attributes.

Regards,
KDSys

Submit an Answer