From dca4914afe94ebd485672b06b9a120e18b452533 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 8 Oct 2025 10:15:41 -0400 Subject: [PATCH] acme: fix autocert TestHTTPHandlerDefaultFallback The Go 1.25.2 release made net/url stricter about parsing bracketed IPv6 hostnames, and is rejecting some test URLs used in the autocert TestHTTPHandlerDefaultFallback test with an error about the colon-separated fields requiring at least one hex digit. This commit replaces the invalid `xxxx` portion of some test URLS with valid hex digits, fixing the test regression. Change-Id: I84c192b1cd6daf53ef4199f7987437fd825f7041 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/710155 Reviewed-by: Roland Shoemaker Auto-Submit: Daniel McCarney Reviewed-by: Filippo Valsorda Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- acme/autocert/autocert_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acme/autocert/autocert_test.go b/acme/autocert/autocert_test.go index 269bc2a..8ca8e2b 100644 --- a/acme/autocert/autocert_test.go +++ b/acme/autocert/autocert_test.go @@ -561,9 +561,9 @@ func TestHTTPHandlerDefaultFallback(t *testing.T) { {"GET", "http://example.org/foo?a=b", 302, "https://example.org/foo?a=b"}, {"GET", "http://example.org:80/foo?a=b", 302, "https://example.org:443/foo?a=b"}, {"GET", "http://example.org:80/foo%20bar", 302, "https://example.org:443/foo%20bar"}, - {"GET", "http://[2602:d1:xxxx::c60a]:1234", 302, "https://[2602:d1:xxxx::c60a]:443/"}, - {"GET", "http://[2602:d1:xxxx::c60a]", 302, "https://[2602:d1:xxxx::c60a]/"}, - {"GET", "http://[2602:d1:xxxx::c60a]/foo?a=b", 302, "https://[2602:d1:xxxx::c60a]/foo?a=b"}, + {"GET", "http://[2602:d1:abcd::c60a]:1234", 302, "https://[2602:d1:abcd::c60a]:443/"}, + {"GET", "http://[2602:d1:abcd::c60a]", 302, "https://[2602:d1:abcd::c60a]/"}, + {"GET", "http://[2602:d1:abcd::c60a]/foo?a=b", 302, "https://[2602:d1:abcd::c60a]/foo?a=b"}, {"HEAD", "http://example.org", 302, "https://example.org/"}, {"HEAD", "http://example.org/foo", 302, "https://example.org/foo"}, {"HEAD", "http://example.org/foo/bar/", 302, "https://example.org/foo/bar/"},