How to disable cURL SSL certificate verification

SslCurlSsl Certificate

Ssl Problem Overview


Hello i want to use an API for a website but there an error with my curl command.

I want to disable SSL certificate verification.

curl: (60) SSL certificate problem: self signed certificate in certificate chain
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.

Ssl Solutions


Solution 1 - Ssl

Simply add the -k switch somewhere before the url.

Disclaimer: Use this at your own risk.

man curl | less +/--insecure

> -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 > > See also --proxy-insecure and --cacert

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMicky View Question on Stackoverflow
Solution 1 - SslGilles QuenotView Answer on Stackoverflow