From 423ff5e20f37cc568143f9193f2a18b8299594f7 Mon Sep 17 00:00:00 2001 From: Jay Rogers Date: Wed, 27 Aug 2025 12:22:08 -0500 Subject: [PATCH] Add support for ".test" suffix in internal subject checks and update tests This commit enhances the SubjectIsInternal function to recognize subjects ending with ".test" as internal. Additionally, two new test cases have been added to validate this behavior in the certificates_test.go file. --- certificates.go | 1 + certificates_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/certificates.go b/certificates.go index 2c20e4cb..fdc026c8 100644 --- a/certificates.go +++ b/certificates.go @@ -609,6 +609,7 @@ func SubjectIsInternal(subj string) bool { strings.HasSuffix(subj, ".local") || strings.HasSuffix(subj, ".internal") || strings.HasSuffix(subj, ".home.arpa") || + strings.HasSuffix(subj, ".test") || isInternalIP(subj) } diff --git a/certificates_test.go b/certificates_test.go index f8ecc3df..ea744f08 100644 --- a/certificates_test.go +++ b/certificates_test.go @@ -167,6 +167,8 @@ func TestSubjectQualifiesForPublicCert(t *testing.T) { {"foo.bar.internal", false}, {"foo.home.arpa", false}, {"foo.bar.home.arpa", false}, + {"foo.test", false}, + {"foo.bar.test", false}, {"192.168.1.3", false}, {"10.0.2.1", false}, {"169.112.53.4", true},