From 29e4cce2c31f4b9470628532654dda733b7effea Mon Sep 17 00:00:00 2001 From: Simon Buttgereit Date: Fri, 17 May 2024 16:20:21 +0200 Subject: [PATCH] fixes for other configurations --- openssl/src/ssl/connector.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs index 66d1bd8939..c1898f3e32 100644 --- a/openssl/src/ssl/connector.rs +++ b/openssl/src/ssl/connector.rs @@ -460,8 +460,9 @@ cfg_if! { fn verify_hostname(domain: &str, cert: &X509Ref) -> bool { match cert.subject_alt_names() { - Some(names) => verify_subject_alt_names(domain, names), - None => verify_subject_name(domain, &cert.subject_name()), + Ok(names) => verify_subject_alt_names(domain, names), + Err(X509D2iError::extension_not_found_error) => verify_subject_name(domain, &cert.subject_name()), + Err(e) => panic!("Error when fetching alt names from certificate: {}", e), } }