mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 05:28:42 +00:00
Set min TLS ver to 1.2 for https only mode
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
9b62ebdae1
commit
691bc18dd0
2 changed files with 8 additions and 1 deletions
|
@ -53,6 +53,10 @@ pub fn new_reqwest_client_builder() -> ClientBuilder {
|
|||
if let Some((https_only, min_tls_ver_opt)) = REQWESTGLOBALCONFIG.get() {
|
||||
builder = builder.https_only(*https_only);
|
||||
|
||||
if *https_only {
|
||||
builder = builder.min_tls_version(reqwest::tls::Version::TLS_1_2);
|
||||
}
|
||||
|
||||
if let Some(min_tls_ver) = *min_tls_ver_opt {
|
||||
builder = builder.min_tls_version(min_tls_ver.into());
|
||||
}
|
||||
|
|
|
@ -84,7 +84,10 @@ struct Options {
|
|||
#[clap(long)]
|
||||
no_cleanup: bool,
|
||||
|
||||
/// Enable https only mode
|
||||
/// Enable https only mode.
|
||||
///
|
||||
/// When https only mode is enabled, it will also set
|
||||
/// minimum TLS version to tls1_2.
|
||||
#[clap(long)]
|
||||
https_only_mode: bool,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue