Skip to content

Commit

Permalink
fix cert blacklist reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Snawoot committed Jan 4, 2025
1 parent 3514865 commit eb822b1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions auth/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ func NewCertAuth(param_url *url.URL, logger *clog.CondLogger) (*CertAuth, error)
}
auth.blacklist.Store(new(serialNumberSetFile))

if auth.blacklistFilename != "" {
if err := auth.reload(); err != nil {
return nil, fmt.Errorf("unable to load initial certificate blacklist: %w", err)
}
}

reloadInterval := 15 * time.Second
if reloadIntervalOption := values.Get("reload"); reloadIntervalOption != "" {
parsedInterval, err := time.ParseDuration(reloadIntervalOption)
Expand All @@ -57,8 +51,13 @@ func NewCertAuth(param_url *url.URL, logger *clog.CondLogger) (*CertAuth, error)
}
reloadInterval = parsedInterval
}
if reloadInterval > 0 {
go auth.reloadLoop(reloadInterval)
if auth.blacklistFilename != "" {
if err := auth.reload(); err != nil {
return nil, fmt.Errorf("unable to load initial certificate blacklist: %w", err)
}
if reloadInterval > 0 {
go auth.reloadLoop(reloadInterval)
}
}

return auth, nil
Expand Down

0 comments on commit eb822b1

Please sign in to comment.