Skip to content

Commit

Permalink
fix: Rustls backend loads only the first certificate from file (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn authored Jan 18, 2024
1 parent ffff848 commit 0e526ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/core/src/conn/rustls/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ impl Keycert {

fn build_certified_key(&mut self) -> IoResult<CertifiedKey> {
let cert = rustls_pemfile::certs(&mut self.cert.as_ref())
.map(|certs| certs.into_iter().collect::<Vec<CertificateDer<'static>>>())
.next()
.ok_or_else(|| IoError::new(ErrorKind::Other, "failed to parse tls certificates"))?;
.flat_map(|certs| certs.into_iter().collect::<Vec<CertificateDer<'static>>>())
.collect::<Vec<_>>();

let key = {
let mut pkcs8 = rustls_pemfile::pkcs8_private_keys(&mut self.key.as_ref())
Expand Down

0 comments on commit 0e526ad

Please sign in to comment.