Skip to content

Commit fe2a1f4

Browse files
Merge pull request #226 from influxdata/dependabot/cargo/rustls-pemfile-2.0
chore(deps): update rustls-pemfile requirement from 1.0 to 2.0
2 parents fca2b49 + 9e09c96 commit fe2a1f4

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ once_cell = "1.9"
4949
procspawn = "1.0"
5050
proptest = "1"
5151
proptest-derive = "0.4"
52-
rustls-pemfile = "1.0"
52+
rustls-pemfile = "2.0"
5353
rdkafka = { version = "0.34", default-features = false, features = ["libz", "tokio", "zstd"] }
5454
tokio = { version = "1.14", features = ["macros", "rt-multi-thread"] }
5555
tracing-log = "0.2"

tests/client.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,26 +213,22 @@ async fn test_tls() {
213213
let mut reader = std::io::BufReader::new(file);
214214
match rustls_pemfile::read_one(&mut reader).unwrap().unwrap() {
215215
rustls_pemfile::Item::X509Certificate(key) => {
216-
root_store
217-
.add(rustls::pki_types::CertificateDer::from(key))
218-
.unwrap();
216+
root_store.add(key).unwrap();
219217
}
220218
_ => unreachable!(),
221219
}
222220

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

230228
let file = std::fs::File::open("/tmp/ca.key").unwrap();
231229
let mut reader = std::io::BufReader::new(file);
232230
let private_key = match rustls_pemfile::read_one(&mut reader).unwrap().unwrap() {
233-
rustls_pemfile::Item::PKCS8Key(key) => rustls::pki_types::PrivateKeyDer::Pkcs1(
234-
rustls::pki_types::PrivatePkcs1KeyDer::from(key),
235-
),
231+
rustls_pemfile::Item::Pkcs8Key(key) => rustls::pki_types::PrivateKeyDer::Pkcs8(key),
236232
_ => unreachable!(),
237233
};
238234

0 commit comments

Comments
 (0)