curl by default will verify each SSL connection to be secure on every connection. You'll get the following SSL verification error when running cURL against https-based websites with the SSL certificates that are either misconfigured, expired, or self-signed.

$ curl
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.

$ curl
curl: (60) SSL: no alternative certificate subject name matches target host name ''
More details here:

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.

You can force curl to ignore ssl certificate errors by using -k or the insecure option.

-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:

       See also --proxy-insecure and --cacert.

curl will ignore SSL checks when initiating connection using the insecure option and you'll be able to bypass any SSL error that any site might have.

$ curl -k
<meta HTTP-EQUIV="REFRESH" content="0; url=/newpage.php">
Discuss the article:

Comment anonymously. Login not required.