Why would you ever do that? This should be a very conscious choice if you decide to ignore the main system keeping the internet traffic trusted.
I know some people feel strongly about this one
But the only time it could lead to a problem is if you pass user/pass and you have a MITM situation.
So maybe only allow it if not passing user and pass
If it’s just a download and we know we aren’t on a TOR node situation then privacy isn’t that great of a concern
My two cents! Open to changing my mind
I mean invest in Smallstep SSH - nope
If software suddenly started accepting invalid certificates, they would have no incentive of rolling it back. HTTPS would make zero sense then.
The script already passes "--location", the non-shortened version of the argument.
For the other things maybe the both safer and more scalable approach is the script should see if it's being run interactively and default to interactively prompting the user for what action to take on detectable things (like missing basic auth or invalid certs for secure domains) or logging an example version of the same command to run as part of the stderr output otherwise. Apart from avoiding debate by taking a stance on what the default should be this will still be allowed by e.g. the Debian repo maintainers.
It does default to https as the proto-default if no scheme is provided - in your example it could default to interactively asking the user however this may fail in automated scenarios and/or hang.
Anyways it’s a good thought exercise. It’s hard to satisfy all use cases equally
I don't want this by default, but for me it's already better than wget since -k is the same thing as --no-check-certificate. Less typing.
Some suggestions:
- Allow insecure URLs by providing -k option automatically for https URLs
- Auto follow HTTP redirects by providing -L option by default
- Rather than use the curl-options setting, just accept —-user and —-pass as options then pass this to curl
I know people will feel strongly about some of these however it would simplify curl usage for a majority of the download only use cases
Other curl options can be used for the more “advanced” use cases like Headers