Skip to content

feat: add 6-days-long and IP address certificates - #91

Open
Itsusinn wants to merge 1 commit into
FlorianUekermann:mainfrom
rust-proxy:feat/ip
Open

feat: add 6-days-long and IP address certificates#91
Itsusinn wants to merge 1 commit into
FlorianUekermann:mainfrom
rust-proxy:feat/ip

Conversation

@Itsusinn

@Itsusinn Itsusinn commented Mar 26, 2026

Copy link
Copy Markdown

Adds support for ACME orders for IP addresses in addition to DNS names.

Related Issue #89

@Itsusinn

Copy link
Copy Markdown
Author

@FlorianUekermann 🥰
I ran a test on my own server, and it works fine.

In addition, I’d like to replace that portion of the ACME client code in the codebase with https://github.com/djc/instant-acme.

@FlorianUekermann

Copy link
Copy Markdown
Owner

Sorry for the slow response. I was on vacation for a month.

Thank you for the PR. I'll take a look at this asap, but need to catch up on some other stuff first.

In addition, I’d like to replace that portion of the ACME client code in the codebase with https://github.com/djc/instant-acme.

That would mean depending on their http client (hyper), right? I'm very attached to our runtime agnostic non-spawning http client.

@cpu

cpu commented Apr 21, 2026

Copy link
Copy Markdown

That would mean depending on their http client (hyper), right?

The hyper client implementation is optional and behind a feature flag that can be avoided with default-features = false.

I'm very attached to our runtime agnostic non-spawning http client.

Would it fit into the shape of our http-client trait ? The intent there was to let folks bring alternative implementations and if it doesn't meet your needs I think it would be worth an issue on our repo.

Comment thread src/acme.rs
Comment on lines 87 to +89
pub async fn new_order(&self, client_config: &Arc<ClientConfig>, domains: Vec<String>) -> Result<(String, Order), AcmeError> {
let domains: Vec<Identifier> = domains.into_iter().map(Identifier::Dns).collect();
let payload = format!("{{\"identifiers\":{}}}", serde_json::to_string(&domains)?);
let mut has_ip = false;
let domains: Vec<Identifier> = domains

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the IpAddr type for this. We should probably add an ips argument to AcmeConfig::new().

Comment thread src/acme.rs
.collect();
let payload = if has_ip {
serde_json::to_string(&serde_json::json!({
"identifiers": domains,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to use some canonicalized text form here (see RFCs for details). Using the IpAddr type throughout the crate would probably resolve that issue.

@Itsusinn Itsusinn May 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed into IpAddr::to_string

Comment thread src/resolver.rs
Comment on lines 66 to 80
match client_hello.server_name() {
None => {
log::debug!("client did not supply SNI");
None
match &self.inner.lock().unwrap().challenge_data {
Some(ChallengeData::TlsAlpn01 { sni, cert }) => {
if sni.parse::<std::net::IpAddr>().is_ok() {
log::debug!("returning IP challenge cert for {}", sni);
Some(cert.clone())
} else {
None
}
}
_ => None,
}
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the cert authority specify a server name like 1.2.0.192.in-addr.arpa, so we would never hit this branch? I would expect that no changes are needed here if sni is stored in the correct format in the challenge data.

justindthomas added a commit to justindthomas/dnsd that referenced this pull request May 16, 2026
DDR verified discovery (RFC 9462 §4) requires the encrypted
resolver's TLS certificate to assert the resolver's IP address as an
iPAddress SAN. Upstream rustls-acme 0.15 models only DNS identifiers
(`enum Identifier { Dns(String) }`), so it cannot request such a
cert.

Pin to the rust-proxy fork's `feat/ip` branch (PR
FlorianUekermann/rustls-acme#91), which adds `Identifier::Ip` and
selects Let's Encrypt's `shortlived` profile when any identifier is
an IP. The public API is unchanged — IP-address strings in the
existing `dns.tls.acme.domains` list are auto-detected — so no
src/acme/ code change is needed. Revisit once #91 merges and ships.
@Itsusinn

Itsusinn commented Jun 5, 2026

Copy link
Copy Markdown
Author

@FlorianUekermann check the latest changes, let me know if it's still not proper

@Itsusinn
Itsusinn force-pushed the feat/ip branch 3 times, most recently from c7f180c to d5ed825 Compare June 9, 2026 05:40
@Itsusinn
Itsusinn requested a review from FlorianUekermann June 9, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants