-
Notifications
You must be signed in to change notification settings - Fork 21
/
misc_test.go
37 lines (30 loc) · 990 Bytes
/
misc_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package acme
import "testing"
func TestWildcard(t *testing.T) {
d := "*." + randString() + ".com"
account, order, _ := makeOrderFinalised(t, []string{ChallengeTypeDNS01}, Identifier{Type: "dns", Value: d})
certs, err := testClient.FetchCertificates(account, order.Certificate)
if err != nil {
t.Fatalf("error fetch cert: %v", err)
}
if len(certs) == 0 {
t.Fatal("no certs")
}
if err := certs[0].VerifyHostname(d); err != nil {
t.Fatalf("error verifying hostname %s: %v", d, err)
}
}
func TestWildcardDNSAccount(t *testing.T) {
d := "*." + randString() + ".com"
account, order, _ := makeOrderFinalised(t, []string{ChallengeTypeDNSAccount01}, Identifier{Type: "dns", Value: d})
certs, err := testClient.FetchCertificates(account, order.Certificate)
if err != nil {
t.Fatalf("error fetch cert: %v", err)
}
if len(certs) == 0 {
t.Fatal("no certs")
}
if err := certs[0].VerifyHostname(d); err != nil {
t.Fatalf("error verifying hostname %s: %v", d, err)
}
}