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:
Jiahao XU 2022-06-23 13:03:50 +10:00
parent 9b62ebdae1
commit 691bc18dd0
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
2 changed files with 8 additions and 1 deletions

View file

@ -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());
}

View file

@ -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,