cargo icon indicating copy to clipboard operation
cargo copied to clipboard

deprecate or warn about downloads over unencrypted HTTP

Open benaryorg opened this issue 6 years ago • 3 comments

Describe the problem you are trying to solve

In light of recent developments in the Java ecosystem I think Rust should follow that and also mark "http" sources as deprecated or warn about them in some way.

Describe the solution you'd like

Correct me if I'm wrong here, but pulling sources from http:// instead of directly from crates.io, likely via git does require putting it in its own Toml section either way, right? One could then require a switch similar to allow-unencrypted-http = true. In a first step just outputting a warning/deprecation notice if this is not set but the source is http:// should be fine, and after some time one could then switch to this aborting the build.

Notes

This would in the second stage break builds, with the fix being a configuration option.

benaryorg avatar Jun 29 '19 12:06 benaryorg

Hi,

In case this issue land into the git tree, it is probably a good idea to keep http download when we can provide a signature hash to verify the integrity of the file after download, because https is expensive and the issue is the absence of integrity check somewhere, and https is a mitigation that is not perfect with regard to that.

alexandre-janniaux avatar Jul 10 '20 08:07 alexandre-janniaux

An opt-in https mode would resolve this and not break environments which require insecure connections.

A warn would encourage better practices.

eslerm avatar Jul 27 '23 19:07 eslerm

This sounds good to me. Once Cargo gets https://github.com/rust-lang/cargo/issues/12115 landed and has its own lint control system, we could start rolling out this kind of warning.

weihanglo avatar Aug 11 '23 20:08 weihanglo