Skip to content

Commit

Permalink
Update rustls-pemfile to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Dec 2, 2023
1 parent e45591a commit c43a4ea
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 39 deletions.
143 changes: 108 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ clap_complete_command = { version = "0.5.1", optional = true }

# cross compile
cargo-zigbuild = { version = "0.18.0", default-features = false, optional = true }
cargo-xwin = { version = "0.16.0", default-features = false, optional = true }
cargo-xwin = { version = "0.16.2", default-features = false, optional = true }

# log
tracing = "0.1.36"
Expand All @@ -101,7 +101,7 @@ multipart = { version = "0.18.0", features = ["client"], default-features = fals
ureq = { version = "2.9.1", features = ["gzip", "json", "socks-proxy"], default-features = false, optional = true }
native-tls = { version = "0.2.8", optional = true }
rustls = { version = "0.21.9", optional = true }
rustls-pemfile = { version = "1.0.1", optional = true }
rustls-pemfile = { version = "2.0.0", optional = true }
keyring = { version = "2.0.0", default-features = false, features = ["linux-no-secret-service"], optional = true }
wild = { version = "2.1.0", optional = true }
url = { version = "2.5.0", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ fn http_agent() -> Result<ureq::Agent, UploadError> {
let mut tls_builder = native_tls::TlsConnector::builder();
if let Some(ca_bundle) = tls_ca_bundle() {
let mut reader = io::BufReader::new(File::open(ca_bundle)?);
for cert in rustls_pemfile::certs(&mut reader)? {
for cert in rustls_pemfile::certs(&mut reader) {
let cert = cert?;
tls_builder.add_root_certificate(native_tls::Certificate::from_pem(&cert)?);
}
}
Expand All @@ -387,7 +388,7 @@ fn http_agent() -> Result<ureq::Agent, UploadError> {
let builder = ureq::builder().try_proxy_from_env(true);
if let Some(ca_bundle) = tls_ca_bundle() {
let mut reader = io::BufReader::new(File::open(ca_bundle)?);
let certs = rustls_pemfile::certs(&mut reader)?;
let certs = rustls_pemfile::certs(&mut reader).collect::<Result<Vec<_>, _>>()?;
let mut root_certs = rustls::RootCertStore::empty();
root_certs.add_parsable_certificates(&certs);
let client_config = rustls::ClientConfig::builder()
Expand Down

0 comments on commit c43a4ea

Please sign in to comment.