Skip to content

Commit

Permalink
Check for .internal with SubjectIsInternal (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickubels committed Aug 10, 2024
1 parent ba418d8 commit 3bad5b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ func SubjectIsInternal(subj string) bool {
return subj == "localhost" ||
strings.HasSuffix(subj, ".localhost") ||
strings.HasSuffix(subj, ".local") ||
strings.HasSuffix(subj, ".internal") ||
strings.HasSuffix(subj, ".home.arpa") ||
isInternalIP(subj)
}
Expand Down
2 changes: 2 additions & 0 deletions certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func TestSubjectQualifiesForPublicCert(t *testing.T) {
{"local", true},
{"foo.local", false},
{"foo.bar.local", false},
{"foo.internal", false},
{"foo.bar.internal", false},
{"foo.home.arpa", false},
{"foo.bar.home.arpa", false},
{"192.168.1.3", false},
Expand Down

0 comments on commit 3bad5b6

Please sign in to comment.