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

2019-05-04 20:11发布

问题:

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?

回答1:

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

echo insecure >> $HOME/.curlrc