Fix some issues with expiry config field.

This commit is contained in:
Jacob Hoffman-Andrews 2015-05-26 14:12:18 -07:00
parent fc71c2540d
commit eecdd91648
3 changed files with 6 additions and 2 deletions

View File

@ -130,6 +130,9 @@ func NewCertificateAuthorityImpl(cadb core.CertificateAuthorityDatabase, config
NotAfter: issuer.NotAfter, NotAfter: issuer.NotAfter,
} }
if config.Expiry == "" {
return nil, errors.New("Config must specify an expiry period.")
}
ca.ValidityPeriod, err = time.ParseDuration(config.Expiry) ca.ValidityPeriod, err = time.ParseDuration(config.Expiry)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -46,7 +46,7 @@
"issuerCert": "test/test-ca.pem", "issuerCert": "test/test-ca.pem",
"_comment": "This should only be present in testMode. In prod use an HSM.", "_comment": "This should only be present in testMode. In prod use an HSM.",
"issuerKey": "test/test-ca.key", "issuerKey": "test/test-ca.key",
"expiry": "8760h", "expiry": "8760h"
}, },
"sa": { "sa": {

View File

@ -45,7 +45,8 @@
"testMode": true, "testMode": true,
"issuerCert": "test/test-ca.pem", "issuerCert": "test/test-ca.pem",
"_comment": "This should only be present in testMode. In prod use an HSM.", "_comment": "This should only be present in testMode. In prod use an HSM.",
"issuerKey": "test/test-ca.key" "issuerKey": "test/test-ca.key",
"expiry": "8760h"
}, },
"sa": { "sa": {