Deprecate --secure, enforce HTTPS (#343)

Resolves #124
This commit is contained in:
Félix Saparelli 2022-09-05 16:18:14 +12:00 committed by GitHub
parent 73f7719e53
commit db82c6935f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 23 deletions

View file

@ -113,15 +113,8 @@ pub struct Args {
#[clap(help_heading = "Options", long)]
pub install_path: Option<PathBuf>,
/// Enforce downloads over secure transports only.
///
/// Insecure HTTP downloads will be removed completely in the future; in the meantime this
/// option forces a fail when the remote endpoint uses plaintext HTTP or insecure TLS suites.
///
/// Without this option, plain HTTP will warn.
///
/// Implies `--min-tls-version=1.2`.
#[clap(help_heading = "Options", long)]
/// Deprecated, here for back-compat only. Secure is now on by default.
#[clap(hide(true), long)]
pub secure: bool,
/// Force a crate to be installed even if it is already installed.

View file

@ -32,7 +32,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien
let desired_targets = get_desired_targets(args.targets.take());
// Initialize reqwest client
let client = create_reqwest_client(args.secure, args.min_tls_version.map(|v| v.into()))?;
let client = create_reqwest_client(args.min_tls_version.map(|v| v.into()))?;
// Build crates.io api client
let crates_io_api_client = crates_io_api::AsyncClient::new(