Skip to content

Commit 329d5cd

Browse files
committed
acme/autocert: add tests for obtaining mixedcase certificates
1 parent 7b1b4fe commit 329d5cd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: acme/autocert/autocert_test.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ func TestGetCertificate_trailingDot(t *testing.T) {
209209
testGetCertificate(t, man, "example.org", hello)
210210
}
211211

212+
func TestGetCertificate_mixedcase(t *testing.T) {
213+
man := &Manager{Prompt: AcceptTOS}
214+
defer man.stopRenew()
215+
216+
lowercaseHello := clientHelloInfo("example.org", true)
217+
testGetCertificate(t, man, "example.org", lowercaseHello)
218+
219+
uppercaseHello := clientHelloInfo("EXAMPLE.ORG", true)
220+
testGetCertificate(t, man, "example.org", uppercaseHello)
221+
}
222+
212223
func TestGetCertificate_ForceRSA(t *testing.T) {
213224
man := &Manager{
214225
Prompt: AcceptTOS,
@@ -906,7 +917,7 @@ func TestCache(t *testing.T) {
906917
}
907918

908919
func TestHostWhitelist(t *testing.T) {
909-
policy := HostWhitelist("example.com", "example.org", "*.example.net")
920+
policy := HostWhitelist("example.com", "EXAMPLE.ORG", "*.example.net")
910921
tt := []struct {
911922
host string
912923
allow bool

0 commit comments

Comments
 (0)