Skip to content

Commit 9df4e34

Browse files
authored
Make NewCertFile config required only when autorenewcert is on, optional otherwise. (#372)
1 parent 0755ca4 commit 9df4e34

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packager/certcache/certcache.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,12 @@ func (this *CertCache) reloadCertIfExpired() {
823823
func PopulateCertCache(config *util.Config, key crypto.PrivateKey,
824824
developmentMode bool, autoRenewCert bool) (*CertCache, error) {
825825

826-
if config.CertFile == "" || config.NewCertFile == "" {
827-
return nil, errors.New("Missing cert file and new cert file paths in config.")
826+
if config.CertFile == "" {
827+
return nil, errors.New("Missing cert file path in config.")
828+
}
829+
830+
if autoRenewCert && config.NewCertFile == "" {
831+
return nil, errors.New("Missing new cert file path in config.")
828832
}
829833

830834
certs, err := certloader.LoadCertsFromFile(config, developmentMode)

0 commit comments

Comments
 (0)