boulder icon indicating copy to clipboard operation
boulder copied to clipboard

Check via zlint if a domain's TLD is valid

Open mcpherrinm opened this issue 1 year ago • 3 comments

If there's discrepencies between the PSL and Zlint TLD list, this will take the most conservative option of rejecting if either list doesn't have a TLD.

mcpherrinm avatar Jan 13 '25 19:01 mcpherrinm

Tests fail because a domain was blocked for the wrong reason, I'll look at an update there in a bit.

mcpherrinm avatar Jan 13 '25 19:01 mcpherrinm

I was incorrect about the reason for the failure. The "TLD" returned from PSL is a string like "co.uk" or "in-addr.arpa", but IsInTLDMap only takes the final component "uk". So I have switched to use HasValidTLD on the full name instead.

zlint has add/remove dates for TLD, which we should use time.Now() for issuance. cert-checker could inadvertently alert here if a TLD is removed between issuance and cert-checker running. I'm not sure if that's worth fixing, or if it is, I don't think I want to take on plumbing fake clocks around.

mcpherrinm avatar Jan 14 '25 01:01 mcpherrinm

I think the best path forward is passing the certificate's issuance time (or time.NotBefore) in, but that's a deeper slice across the codebase.

mcpherrinm avatar Jan 15 '25 18:01 mcpherrinm