Skip to content

Commit

Permalink
Make NewCertFile config required only when autorenewcert is on, optio…
Browse files Browse the repository at this point in the history
…nal otherwise. (#372)
  • Loading branch information
banaag authored Nov 15, 2019
1 parent 0755ca4 commit 9df4e34
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packager/certcache/certcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,12 @@ func (this *CertCache) reloadCertIfExpired() {
func PopulateCertCache(config *util.Config, key crypto.PrivateKey,
developmentMode bool, autoRenewCert bool) (*CertCache, error) {

if config.CertFile == "" || config.NewCertFile == "" {
return nil, errors.New("Missing cert file and new cert file paths in config.")
if config.CertFile == "" {
return nil, errors.New("Missing cert file path in config.")
}

if autoRenewCert && config.NewCertFile == "" {
return nil, errors.New("Missing new cert file path in config.")
}

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

0 comments on commit 9df4e34

Please sign in to comment.