curl --insecure

curl --insecure example curl –insecure example

If you’re trying to access a website over https URL and curl shows you that certificate has expired or may not be trusted, you are likely to get a message like this:

greys@mcfly:~ $ curl https://unixtutorial.test
curl: (60) SSL: no alternative certificate subject name matches target host name 'unixtutorial.test'
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.

Good news! You can still override this behaviour by running curl with the –insecure command line.

WARNING: be sure you know what you’re doing! this is especially true to knowing what website you’re trying to access. It may be fine to ignore SSL warnings for a local dev environment on your laptop or for accessing internal URLs in your private infrastructure. But anything on the public Internet that gives you an SSL warning must be reviwed before you progress.

Using curl –insecure

curl --insecure curl –insecure

How it works: curl –insecure will disable certificate checks but will still encrypt the traffic and download the https URL you provided.

See Also

Keep Learning

Follow me on Facebook, Twitter or Telegram:
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets