cURL Ignore SSL Certificate Warnings

By | 2012/02/14

To ignore any ssl certificate warnings with curl, use the tack k option.


Here is an example:

$ curl -k https://examplewithbadsslcert.com

$ curl -I -k https://examplewithbadsslcert.com
HTTP/1.1 200 OK
Date: Tue, 14 Feb 2012 20:00:03 GMT
Server: Apache
Strict-Transport-Security: max-age=43200; includeSubDomains
X-Frame-Options: SAMEORIGIN
Set-Cookie: bb2_screener_=1329249603+66.202.152.198; path=/
Set-Cookie: PHPSESSID=lq5dpvfagbdstib7nlg2b8a0m7; path=/
X-Hello: Hello There
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8


Without tack k, you’ll get various SSL certificate problem errors such as:

$ curl -I https://examplewithbadsslcert.com
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Cool!

6 thoughts on “cURL Ignore SSL Certificate Warnings

  1. Mirko

    It is possible to disable SSL certificate check in CURL. My performance data shows no difference with or without option -k. In SSH its possible to disable the strict certificate check. Is this possible in CURL?

    Reply
  2. Jabiulla

    Certificate Verification Error


    A certificate verification error occured

    Overview:
    The access to the URL scottlinux.com is restricted because the validation of the certificate failed

    Details:
    VERIFY DENY: depth=0, Unknown revocation state: “li166-66.members.linode.com”

    Options:

    Pressing the button allows you to visit the website although the certificate is not valid.
    Pressing the button allows you to go to the previous page.
    To find out more about the reason for the block message, please contact your administrator and refer to ID 340109.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.