Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set cURL default --insecure option?

I have to execute a command which executes a few other set of commands automatically. One of those commands is:

curl -k https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip

But I want this command to run with an --insecure flag so that the verification of curl's certificate doesn't take place as I'm behind a corporate proxy.

I understand that I need to edit the .curlrc file to add the --insecure option.

I checked my $HOME directory, and such a file doesn't exist. Should a create a new .curlrc file? What should be its content to start with? How does a sample .curlrc file look like? What all are its contents?

I found this link: Sample .curlrc file. However, this doesn't explain things clearly.

like image 603
Akhil Kintali Avatar asked Oct 13 '25 04:10

Akhil Kintali


1 Answers

I found that you can just create the $HOME/.curlrc file yourself and it can just contain the -k or --insecure flag without anything else in the file. I have to do this programmatically, so I run this line of code before running the curls:

echo "-k" > ~/.curlrc

like image 160
Josh Avatar answered Oct 16 '25 08:10

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!