Add opt --root-ceritificates & env BINSTALL_HTTPS_ROOT_CERTS (#820)

for specifying root ceritificates used for https connnections.

And remove old environment variable `CARGO_HTTP_CAINFO`, `SSL_CERT_FILE`
and `SSL_CERT_PATH` to avoid accidentally setting them, especially in CI
env.

Also:
 - Rm fn `binstalk_downloader::Certificate::from_env`
 - Enable feature `env` of dep `clap` in `crates/bin`
 - Add new dep `file-format` v0.14.0 to `crates/bin`
 - Use `file-format` to determine pem/der file format when loading root certs
 - Rm fn `binstalk_downloader::Certificate::open` and enum `binstalk_downloader::OpenCertificateError`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-02-20 20:48:33 +11:00 committed by GitHub
parent 467ba0d854
commit 7bc4d4a5c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 62 deletions

7
Cargo.lock generated
View file

@ -361,6 +361,7 @@ dependencies = [
"crates_io_api",
"dirs",
"embed-resource",
"file-format",
"fs-lock",
"log",
"miette",
@ -727,6 +728,12 @@ dependencies = [
"instant",
]
[[package]]
name = "file-format"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d645737d3dda11cbf14905e9b943a1bd578cdcb751709b581a924ea9b9b18b5c"
[[package]]
name = "filetime"
version = "0.2.20"