From dd92373132610967102e2f3251b44fda7646d912 Mon Sep 17 00:00:00 2001 From: Jeff Thomas Date: Wed, 22 Jan 2025 11:37:38 -0800 Subject: [PATCH] Fixes Issue#1113: TLS: Ignore certs in pem file when loading private keys --- src/tls.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tls.rs b/src/tls.rs index aa7438752..8100dc3f9 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -196,6 +196,8 @@ impl TlsConfigBuilder { rustls_pemfile::Item::Pkcs1Key(k) => key_opt = Some(k.into()), rustls_pemfile::Item::Pkcs8Key(k) => key_opt = Some(k.into()), rustls_pemfile::Item::Sec1Key(k) => key_opt = Some(k.into()), + // Ignore certs in the same pem file as private key + rustls_pemfile::Item::X509Certificate(_) => {} _ => return Err(TlsConfigError::UnknownPrivateKeyFormat), } }