Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set cURL to always use the -k option?

For some reason my version of darwin/bash/evn variables is not letting me co anything from the command line with https, I dunno why, but I have tried everything.

But I have found that cURL (the mean reason this is a problem for) can take a -k option or --insecure. This isn't great but its a hack that will work for now.

Could I just user alias curl='curl -k' ? I have never aliased something to overwrite a command that actually exists, will that even work?

like image 369
James Vince Avatar asked Jul 31 '12 07:07

James Vince


People also ask

How do you use curl options?

To make an OPTIONS request with Curl, you must pass the -X OPTIONS command-line parameter to the Curl request. Browsers send OPTIONS requests when making a CORS request to another origin. The OPTIONS request does not return any data. All information is returned in the response headers.

What is curl K option?

The option tells curl to skip the verification of the server's TLS certificate – it will skip the cryptographic certificate verification (that it was signed by a trusted CA) and it will skip other certificate checks, like that it was made for the host name curl connects to and that it hasn't expired etc.

How do I pass the user agent in curl?

You can use the -A or --user-agent command-line option to pass your own User-Agent string to Curl. By default, Curl sends its own User-Agent string to the server in the following format: "curl/version. number". For example, when you use the Curl tool version 7.54.


1 Answers

Aliasing commands is usually not a problem. You could also put -k or --insecure into $HOME/.curlrc:

echo insecure >> $HOME/.curlrc
like image 97
Thor Avatar answered Mar 11 '23 11:03

Thor