Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

Let's Encrypt HTTP-01 When Your AAAA Record Points into a Free /48

Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end. Addin

Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end.

Adding an AAAA record for a website changes how certificate issuance works, and it surprises people every week. When a name has both A and AAAA records, Let's Encrypt's validation servers prefer IPv6. If your server answers HTTP-01 challenges correctly over IPv4 but not over IPv6, issuance and renewals can fail even though the site looks fine in your browser. This guide covers getting HTTP-01 right for servers numbered from a free IPv6 /48 from IPYE, with www.example.net pointing at 2001:db8:100:10::20.

How the validation works

For HTTP-01, the certificate authority asks your ACME client to place a token at http://www.example.net/.well-known/acme-challenge/<token> and then fetches it from several network locations. With an AAAA record present, the fetch uses IPv6. Treat that as the path that must work; do not rely on any fallback to IPv4.

That means four things must be true over IPv6:

  1. the AAAA record points at the right server
  2. the /48 is routed to your network, so packets arrive
  3. port 80 is open on IPv6 in every firewall on the path
  4. the web server listens on IPv6 port 80 and serves the challenge path

Check each step from outside

From a machine on another network:

dig +short AAAA www.example.net
curl -6 -v http://www.example.net/.well-known/acme-challenge/test

The first command must return 2001:db8:100:10::20. The second should reach your server and return a 404 for the made-up token, which proves the path is reachable. A timeout means routing or a firewall; a connection refused means nothing listens on port 80 over IPv6.

Also check that the AAAA record is the same on every authoritative name server for the zone. Validation servers query from several locations, and a secondary that still serves an old AAAA record sends some of them to an address that no longer hosts the site. dig +short AAAA www.example.net @ns1.example.net against each server answers this in seconds.

To test the IPv6 path even when your own machine has no IPv6, use a remote shell on an IPv6-capable host, or an online HTTP checker that supports IPv6.

The web server must listen on IPv6 port 80

nginx needs an explicit IPv6 listener:

server {
    listen 80;
    listen [::]:80;
    server_name www.example.net;

    location /.well-known/acme-challenge/ {
        root /var/www/acme;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}

The missing listen [::]:80; line is the most common cause of IPv6-only validation failures. The redirect for everything else is fine, as long as the challenge path is served directly. Let's Encrypt does follow redirects from HTTP to HTTPS for challenges, but keeping the challenge on plain HTTP removes a dependency on a working certificate.

For Apache, Listen 80 without an address listens on both families by default; check with ss -tlnp that [::]:80 or *:80 appears.

Firewalls

Open port 80 on IPv6 in the host firewall and in any network firewall in front of the server. It is common to find port 80 open for IPv4 and closed for IPv6 because the IPv6 rules were written separately or not at all. Many people close port 80 after moving everything to HTTPS; with HTTP-01, it must stay open, or you should switch to DNS-01 validation.

Watch renewals, not just the first issuance

The first certificate is usually issued while you are watching. Renewals run unattended sixty days later, after someone may have changed a firewall, moved a server or edited DNS. Test the renewal path ahead of time:

certbot renew --dry-run

and monitor certificate expiry from outside, over IPv6, so you hear about a failed renewal weeks before the certificate expires.

When DNS-01 is better

If the server is not reachable from the Internet on port 80, or you need wildcard certificates, use DNS-01 instead. It proves control of the name through a TXT record and does not care whether the server is reachable over IPv4 or IPv6. For publicly reachable web servers, HTTP-01 remains the simplest option.

Make the address reachable first

None of this works until the /48 is announced and accepted. Your upstream will want the LOA from the IPYE client portal, and the ROA that IPYE creates helps the route pass RPKI filtering on the networks the validation servers use.

Next step

Claim your free /48, add listen [::]:80 to every server block that answers challenges, and run a dry-run renewal over IPv6 before you rely on it. Questions: [email protected].

About IPYE

IPYE (https://ipye.com) leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. ASN and region changes apply automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS; WHOIS is editable on IPv6 /44 and larger. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. Claim your free /48: https://my.ipye.com/products/ipv6-rental. Questions: [email protected].

Disclosure: I run IPYE

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.