|
6 | 6 | use std::collections::HashMap; |
7 | 7 | use std::error::Error as StdError; |
8 | 8 | use std::io::{self, Read}; |
| 9 | +use std::net::IpAddr; |
9 | 10 | use std::path::Path; |
10 | 11 | use std::process::{Child, Command}; |
| 12 | +use std::str::FromStr; |
11 | 13 | use std::sync::atomic::{AtomicU16, Ordering}; |
12 | 14 | use std::time::Duration; |
13 | 15 | use std::{env, fs}; |
@@ -50,9 +52,13 @@ use tracing_subscriber::{EnvFilter, fmt}; |
50 | 52 | async fn http_01() -> Result<(), Box<dyn StdError>> { |
51 | 53 | try_tracing_init(); |
52 | 54 |
|
| 55 | + let mut identifiers = dns_identifiers(["http01.example.com"]); |
| 56 | + identifiers.push(Identifier::Ip(IpAddr::from_str("::1").unwrap())); |
| 57 | + identifiers.push(Identifier::Ip(IpAddr::from_str("127.0.0.1").unwrap())); |
| 58 | + |
53 | 59 | Environment::new(EnvironmentConfig::default()) |
54 | 60 | .await? |
55 | | - .test::<Http01>(&NewOrder::new(&dns_identifiers(["http01.example.com"]))) |
| 61 | + .test::<Http01>(&NewOrder::new(&identifiers)) |
56 | 62 | .await |
57 | 63 | .map(|_| ()) |
58 | 64 | } |
@@ -476,6 +482,7 @@ impl Environment { |
476 | 482 | let server_name = match (ident.identifier, ident.wildcard) { |
477 | 483 | (Identifier::Dns(domain), true) => format!("foo.{domain}"), |
478 | 484 | (Identifier::Dns(_), false) => ident.to_string(), |
| 485 | + (Identifier::Ip(addr), _) => addr.to_string(), |
479 | 486 | _ => unreachable!("unsupported identifier {ident:?}"), |
480 | 487 | }; |
481 | 488 |
|
|
0 commit comments