Private
Public Access
1
0

fix(ca): strip CIDR netmask from IP before adding to server cert SANs
All checks were successful
CI Pipeline / Rust Format Check (push) Successful in 4s
CI Pipeline / Clippy Lints (push) Successful in 52s
CI Pipeline / Rust Unit Tests (push) Successful in 1m12s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Successful in 14s
CI Pipeline / Build .deb & Release (push) Has been skipped

This commit is contained in:
2026-05-18 16:19:39 +00:00
parent d326b25203
commit b3ae42215b

View File

@ -351,7 +351,9 @@ impl CertAuthority {
let mut sans = vec![SanType::DnsName( let mut sans = vec![SanType::DnsName(
Ia5String::try_from(hostname.to_owned()).context("hostname is not valid IA5")?, Ia5String::try_from(hostname.to_owned()).context("hostname is not valid IA5")?,
)]; )];
if let Ok(ip) = ip_address.parse::<IpAddr>() { // Strip CIDR netmask (e.g. "192.168.3.36/32") before parsing
let ip_str = ip_address.split('/').next().unwrap_or(ip_address);
if let Ok(ip) = ip_str.parse::<IpAddr>() {
sans.push(SanType::IpAddress(ip)); sans.push(SanType::IpAddress(ip));
} else { } else {
tracing::warn!( tracing::warn!(