Skip to content

Commit

Permalink
Bump to 0.7.0
Browse files Browse the repository at this point in the history
And bump dependencies from alphas to released versions, fix examples to
accommodate breaking changes.
  • Loading branch information
jsha authored and cpu committed Dec 2, 2023
1 parent 6e483d6 commit 0f55cc4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustls-native-certs"
version = "0.7.0-alpha.3"
version = "0.7.0"
edition = "2021"
rust-version = "1.60"
license = "Apache-2.0 OR ISC OR MIT"
Expand All @@ -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.0.0"
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.0"
rustls-webpki = "0.102.0"
serial_test = "2"
untrusted = "0.7.0" # stick to the version ring depends on for now
webpki-roots = "=0.26.0-alpha.2"
webpki-roots = "0.26.0"
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
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,18 @@ 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);
rustls_pemfile::certs(&mut f)
let certs = rustls_pemfile::certs(&mut f)
.collect::<Result<Vec<_>, _>>()
.map_err(|err| {
Error::new(
ErrorKind::InvalidData,
format!("could not load PEM file {path:?}: {err}"),
)
})
})?;

let certs: Vec<CertificateDer<'static>> = certs
.into_iter()
.map(|c| c.into_owned())
.collect();
Ok(certs)
}
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 0f55cc4

Please sign in to comment.