Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable cert revocation check in unix/linux using curl command

I am using curl command to invoke a rest service. It is as follows:

{curl -X POST --ssl-no-revoke --cacert xyz.pem -K urls.txt -H "Authorization:Basic XYZ" -H "Content-Type:application/json" -d @data.json}

The above command is used to hit the service using one way SSL and basic authorization. The data to be passed is enclosed in data.json file and the urls to be hit are enclosed in urls.txt file.

The above command works perfectly in Windows but when executed from linux, it says:

{curl: option --ssl-no-revoke: is unknown
curl: try 'curl --help' or 'curl --manual' for more information}

I want to disable certificate revocation checks altogether. It looks like {--ssl-no-revoke} works on Windows but not Unix/Linux.

Would like to know if any alternative.

like image 232
user3762991 Avatar asked Jul 02 '18 13:07

user3762991


People also ask

How do I disable SSL certificate verification in curl?

If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

How do I ignore a certificate in curl command?

Make curl Ignore SSL Errors When you try to use curl to connect to such a website, the output responds with an error. Note: The --insecure ( -k ) options is similar to the wget --no-check-certificate command used to avoid certificate authorities checking for a server certificate.

Does curl check SSL certificate?

libcurl performs peer SSL certificate verification by default. This is done by using a CA certificate store that the SSL library can use to make sure the peer's server certificate is valid.


2 Answers

ssl-no-revoke is Windows Only. The only alternative I'm aware of is to have a valid certificate or not use SSL.

https://curl.haxx.se/docs/manpage.html

like image 81
Terry Carmen Avatar answered Sep 20 '22 05:09

Terry Carmen


Using a valid certificate is not always a solution as revocation checks will fail with a valid certificate too when there is no Internet connection (for example, in the presence of a captive portal).

One way is to disable certificate checking altogether, i.e.:

curl --insecure https://www.example.com

Note that this will greatly reduce the security as self signed certificates will also be accepted as well as revoked ones!

like image 37
Selcuk Avatar answered Sep 23 '22 05:09

Selcuk