Skip to content

Commit c794232

Browse files
committed
Fixes Issue#1113: TLS: Ignore certs in pem file when loading private keys
1 parent 1cbf029 commit c794232

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tls.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ impl TlsConfigBuilder {
196196
rustls_pemfile::Item::Pkcs1Key(k) => key_opt = Some(k.into()),
197197
rustls_pemfile::Item::Pkcs8Key(k) => key_opt = Some(k.into()),
198198
rustls_pemfile::Item::Sec1Key(k) => key_opt = Some(k.into()),
199+
// Ignore certs in the same pem file as private key
200+
rustls_pemfile::Item::X509Certificate(_) => {},
199201
_ => return Err(TlsConfigError::UnknownPrivateKeyFormat),
200202
}
201203
}

0 commit comments

Comments
 (0)