Skip to content

Commit 9e0b10f

Browse files
committed
Auto merge of #11307 - ehuss:update-curl, r=epage
Update libcurl This updates to the latest libcurl from 7.83.1 to 7.86.0. There are extensive changes documented thoroughly at https://curl.se/changes.html. There are 5 CVEs as documented at https://curl.se/docs/security.html, though none of them look particularly serious for our use case. This adds a limit of TLS 1.2 for Windows. There have been some issues with TLS 1.3 (which was recently added), and I'm not confident enabling it, yet. Perhaps some day in the future when it looks like it is more reliable, the limit can be removed.
2 parents d4c38af + d014c29 commit 9e0b10f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ bytesize = "1.0"
2121
cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
2222
cargo-util = { path = "crates/cargo-util", version = "0.2.1" }
2323
crates-io = { path = "crates/crates-io", version = "0.34.0" }
24-
curl = { version = "0.4.43", features = ["http2"] }
25-
curl-sys = "0.4.55"
24+
curl = { version = "0.4.44", features = ["http2"] }
25+
curl-sys = "0.4.58"
2626
env_logger = "0.9.0"
2727
pretty_env_logger = { version = "0.4", optional = true }
2828
anyhow = "1.0"

src/cargo/ops/registry.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,24 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
678678
handle.ssl_min_max_version(min_version, max_version)?;
679679
}
680680
}
681+
} else if cfg!(windows) {
682+
// This is a temporary workaround for some bugs with libcurl and
683+
// schannel and TLS 1.3.
684+
//
685+
// Our libcurl on Windows is usually built with schannel.
686+
// On Windows 11 (or Windows Server 2022), libcurl recently (late
687+
// 2022) gained support for TLS 1.3 with schannel, and it now defaults
688+
// to 1.3. Unfortunately there have been some bugs with this.
689+
// https://github.com/curl/curl/issues/9431 is the most recent. Once
690+
// that has been fixed, and some time has passed where we can be more
691+
// confident that the 1.3 support won't cause issues, this can be
692+
// removed.
693+
//
694+
// Windows 10 is unaffected. libcurl does not support TLS 1.3 on
695+
// Windows 10. (Windows 10 sorta had support, but it required enabling
696+
// an advanced option in the registry which was buggy, and libcurl
697+
// does runtime checks to prevent it.)
698+
handle.ssl_min_max_version(SslVersion::Default, SslVersion::Tlsv12)?;
681699
}
682700

683701
if let Some(true) = http.debug {

0 commit comments

Comments
 (0)