Skip to content

Commit 4573529

Browse files
cpudjc
authored andcommitted
pebble: add IP identifiers to HTTP-01 test
Adds an IPv4 and IPv6 address to the HTTP-01 issuance test.
1 parent bfa4cfd commit 4573529

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/pebble.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
use std::collections::HashMap;
77
use std::error::Error as StdError;
88
use std::io::{self, Read};
9+
use std::net::IpAddr;
910
use std::path::Path;
1011
use std::process::{Child, Command};
12+
use std::str::FromStr;
1113
use std::sync::atomic::{AtomicU16, Ordering};
1214
use std::time::Duration;
1315
use std::{env, fs};
@@ -50,9 +52,13 @@ use tracing_subscriber::{EnvFilter, fmt};
5052
async fn http_01() -> Result<(), Box<dyn StdError>> {
5153
try_tracing_init();
5254

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+
5359
Environment::new(EnvironmentConfig::default())
5460
.await?
55-
.test::<Http01>(&NewOrder::new(&dns_identifiers(["http01.example.com"])))
61+
.test::<Http01>(&NewOrder::new(&identifiers))
5662
.await
5763
.map(|_| ())
5864
}
@@ -476,6 +482,7 @@ impl Environment {
476482
let server_name = match (ident.identifier, ident.wildcard) {
477483
(Identifier::Dns(domain), true) => format!("foo.{domain}"),
478484
(Identifier::Dns(_), false) => ident.to_string(),
485+
(Identifier::Ip(addr), _) => addr.to_string(),
479486
_ => unreachable!("unsupported identifier {ident:?}"),
480487
};
481488

0 commit comments

Comments
 (0)