Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NewCertFile config required only when autorenewcert is on, optio… #372

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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