@@ -64,6 +64,7 @@ var invalidCryptoParams = []csr.KeyRequest{
6464func TestInitCA (t * testing.T ) {
6565 var req * csr.CertificateRequest
6666 hostname := "cloudflare.com"
67+ crl := "http://crl.cloudflare.com/655c6a9b-01c6-4eea-bf21-be690cc315e0.crl" //cert_uuid.crl
6768 for _ , param := range validKeyParams {
6869 for _ , caconfig := range validCAConfigs {
6970 req = & csr.CertificateRequest {
@@ -80,6 +81,7 @@ func TestInitCA(t *testing.T) {
8081 Hosts : []string {hostname , "www." + hostname },
8182 KeyRequest : & param ,
8283 CA : & caconfig ,
84+ CRL : crl ,
8385 }
8486 certBytes , _ , keyBytes , err := New (req )
8587 if err != nil {
@@ -94,6 +96,18 @@ func TestInitCA(t *testing.T) {
9496 t .Fatal ("InitCA cert parsing failed:" , err )
9597 }
9698
99+ // Verify if the CRL is set
100+ crlSet := false
101+ for _ , certCrl := range cert .CRLDistributionPoints {
102+ if certCrl == crl {
103+ crlSet = true
104+ break
105+ }
106+ }
107+ if ! crlSet {
108+ t .Fatal ("Missing CRL on certificate" )
109+ }
110+
97111 // Verify key parameters.
98112 switch req .KeyRequest .Algo () {
99113 case "rsa" :
@@ -126,14 +140,15 @@ func TestInitCA(t *testing.T) {
126140 }
127141 }
128142
129- // Replace the default CAPolicy with a test (short expiry) version.
143+ // Replace the default CAPolicy with a test (short expiry) version and add a crl
130144 CAPolicy = func () * config.Signing {
131145 return & config.Signing {
132146 Default : & config.SigningProfile {
133147 Usage : []string {"cert sign" , "crl sign" },
134148 ExpiryString : "300s" ,
135149 Expiry : 300 * time .Second ,
136150 CAConstraint : config.CAConstraint {IsCA : true },
151+ CRL : crl ,
137152 },
138153 }
139154 }
0 commit comments