Enable secure mode for cargo-binstall (#9)

`--secure` mode enforce downloads over secure transports only.
As a result, http will be disabled, and it will also set
min tls version to be 1.2

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU
2022-06-29 01:28:27 +10:00
committed by GitHub
parent 47e0a4c507
commit 03433ef024

View File

@@ -88,12 +88,15 @@ cargo_binstall() {
install_cargo_binstall
# --secure mode enforce downloads over secure transports only.
# As a result, http will be disabled, and it will also set
# min tls version to be 1.2
case "${version}" in
latest)
cargo binstall --no-confirm "$tool"
cargo binstall --secure --no-confirm "$tool"
;;
*)
cargo binstall --no-confirm --version "$version" "$tool"
cargo binstall --secure --no-confirm --version "$version" "$tool"
;;
esac
}