Question

curl not working SSL

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


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted 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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.