Build the SAN list for the server certificate from defaults + extras.
(extra_sans: &[String])
| 129 | |
| 130 | /// Build the SAN list for the server certificate from defaults + extras. |
| 131 | fn build_server_sans(extra_sans: &[String]) -> Vec<SanType> { |
| 132 | let mut sans = Vec::new(); |
| 133 | |
| 134 | for s in DEFAULT_SERVER_SANS { |
| 135 | add_san(&mut sans, s); |
| 136 | } |
| 137 | for s in extra_sans { |
| 138 | add_san(&mut sans, s); |
| 139 | } |
| 140 | |
| 141 | sans |
| 142 | } |
| 143 | |
| 144 | /// Add a SAN, automatically choosing `IpAddress` or `DnsName` based on the value. |
| 145 | fn add_san(sans: &mut Vec<SanType>, value: &str) { |