Fix some issues with expiry config field.
This commit is contained in:
parent
fc71c2540d
commit
eecdd91648
|
@ -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
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
Loading…
Reference in New Issue