3 ms·
So I was curious and tried to figure out how to, client side, enforce TLS 1.2+ for npm. It is surprisingly not straightforward to me. I also had an annoying tim
by staticassertion 5y ago
So I was curious and tried to figure out how to, client side, enforce TLS 1.2+ for npm. It is surprisingly not straightforward to me. I also had an annoying time due to 'npm' being the tool name and the repo name.
It seems you have to set an environment variable,
NODE_OPTIONS=--tls-max-v1.2
But that's for node in general and I'm not sure if it even works for npm. I was expecting this to be something I could do in a package.json
I've done this for Rust for a long time by just setting a flag in `project/.cargo/config.toml`
[http]
ssl-version.min = "tlsv1.2"
(side note - I've had 0 issues with tlsv1.3 in cargo with crates.io)
I also wasn't able to figure out how to do this for `pip`. I honestly expected this to be super straightforward, but I guess I was sort of spoiled by how easy it was with cargo.
- minitech 5y ago`--tls-max-v1.2` does what it sounds like and sets the maximum version to 1.2. You want `--tls-min-v1.2`. (Also, this just controls the default minimum version when code doesn’t specify one explicitly, and the default minimum is already TLS 1.2 on the latest Node.)
- staticassertion 5y agoNice, thank you.