config: use getters for certificates (#2001)

* config: use getters for certificates

* update log message
This commit is contained in:
Caleb Doxsey 2021-03-23 08:02:50 -06:00 committed by GitHub
parent 36eeff296a
commit 853d2dd478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 101 additions and 51 deletions

View file

@ -23,11 +23,16 @@ func (cfg *Config) Clone() *Config {
}
// AllCertificates returns all the certificates in the config.
func (cfg *Config) AllCertificates() []tls.Certificate {
func (cfg *Config) AllCertificates() ([]tls.Certificate, error) {
optionCertificates, err := cfg.Options.GetCertificates()
if err != nil {
return nil, err
}
var certs []tls.Certificate
certs = append(certs, cfg.Options.Certificates...)
certs = append(certs, optionCertificates...)
certs = append(certs, cfg.AutoCertificates...)
return certs
return certs, nil
}
// Checksum returns the config checksum.