Skip to content

Commit

Permalink
chore(deps): update rustls-pemfile requirement from 1.0 to 2.0
Browse files Browse the repository at this point in the history
Updates the requirements on [rustls-pemfile](https://github.com/rustls/pemfile) to permit the latest version.
- [Release notes](https://github.com/rustls/pemfile/releases)
- [Commits](rustls/pemfile@v/1.0.0...v/2.0.0)

---
updated-dependencies:
- dependency-name: rustls-pemfile
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] authored and crepererum committed Dec 11, 2023
1 parent fca2b49 commit 9e09c96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ once_cell = "1.9"
procspawn = "1.0"
proptest = "1"
proptest-derive = "0.4"
rustls-pemfile = "1.0"
rustls-pemfile = "2.0"
rdkafka = { version = "0.34", default-features = false, features = ["libz", "tokio", "zstd"] }
tokio = { version = "1.14", features = ["macros", "rt-multi-thread"] }
tracing-log = "0.2"
Expand Down
10 changes: 3 additions & 7 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,26 +213,22 @@ async fn test_tls() {
let mut reader = std::io::BufReader::new(file);
match rustls_pemfile::read_one(&mut reader).unwrap().unwrap() {
rustls_pemfile::Item::X509Certificate(key) => {
root_store
.add(rustls::pki_types::CertificateDer::from(key))
.unwrap();
root_store.add(key).unwrap();
}
_ => unreachable!(),
}

let file = std::fs::File::open("/tmp/ca.crt").unwrap();
let mut reader = std::io::BufReader::new(file);
let producer_root = match rustls_pemfile::read_one(&mut reader).unwrap().unwrap() {
rustls_pemfile::Item::X509Certificate(key) => rustls::pki_types::CertificateDer::from(key),
rustls_pemfile::Item::X509Certificate(key) => key,
_ => unreachable!(),
};

let file = std::fs::File::open("/tmp/ca.key").unwrap();
let mut reader = std::io::BufReader::new(file);
let private_key = match rustls_pemfile::read_one(&mut reader).unwrap().unwrap() {
rustls_pemfile::Item::PKCS8Key(key) => rustls::pki_types::PrivateKeyDer::Pkcs1(
rustls::pki_types::PrivatePkcs1KeyDer::from(key),
),
rustls_pemfile::Item::Pkcs8Key(key) => rustls::pki_types::PrivateKeyDer::Pkcs8(key),
_ => unreachable!(),
};

Expand Down

0 comments on commit 9e09c96

Please sign in to comment.