Skip to content

Commit

Permalink
Cargo: update dependencies
Browse files Browse the repository at this point in the history
Bump dependencies from alphas to released versions, fix examples to
accommodate breaking changes.
  • Loading branch information
jsha authored and cpu committed Dec 3, 2023
1 parent 4a6041d commit 2b49028
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ repository = "https://github.com/rustls/rustls-native-certs"
categories = ["network-programming", "cryptography"]

[dependencies]
rustls-pemfile = "=2.0.0-alpha.2"
pki-types = { package = "rustls-pki-types", version = "0.2.2" }
rustls-pemfile = "2"
pki-types = { package = "rustls-pki-types", version = "1" }

[dev-dependencies]
ring = "0.16.5"
rustls = "=0.22.0-alpha.6"
rustls-webpki = "=0.102.0-alpha.8"
rustls = "0.22"
rustls-webpki = "0.102"
serial_test = "2"
untrusted = "0.7" # stick to the version ring depends on for now
webpki-roots = "=0.26.0-alpha.2"
webpki-roots = "0.26"
x509-parser = "0.15"

[target.'cfg(windows)'.dependencies]
Expand Down
1 change: 0 additions & 1 deletion examples/google.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fn main() {
}

let config = rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(roots)
.with_no_client_auth();

Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ fn load_certs_from_env() -> Option<Result<Vec<CertificateDer<'static>>, Error>>
}

fn load_pem_certs(path: &Path) -> Result<Vec<CertificateDer<'static>>, Error> {
let f = File::open(path)?;
let mut f = BufReader::new(f);
let mut f = BufReader::new(File::open(path)?);
rustls_pemfile::certs(&mut f)
.collect::<Result<Vec<_>, _>>()
.map_err(|err| {
Error::new(
.map(|result| match result {
Ok(der) => Ok(der),
Err(err) => Err(Error::new(
ErrorKind::InvalidData,
format!("could not load PEM file {path:?}: {err}"),
)
)),
})
.collect()
}
1 change: 0 additions & 1 deletion tests/smoketests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn check_site(domain: &str) {
}

let config = rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(roots)
.with_no_client_auth();

Expand Down

0 comments on commit 2b49028

Please sign in to comment.