mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
config: change certificates
config key parsing to attempt Base64 decoding first. (#1055)
This commit is contained in:
parent
a5db94434d
commit
253addcad6
2 changed files with 41 additions and 2 deletions
|
@ -558,9 +558,12 @@ func (o *Options) Validate() error {
|
|||
}
|
||||
|
||||
for _, c := range o.CertificateFiles {
|
||||
cert, err := cryptutil.CertificateFromFile(c.CertFile, c.KeyFile)
|
||||
cert, err := cryptutil.CertificateFromBase64(c.CertFile, c.KeyFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("config: bad cert file %w", err)
|
||||
cert, err = cryptutil.CertificateFromFile(c.CertFile, c.KeyFile)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("config: bad cert entry, base64 or file reference invalid. %w", err)
|
||||
}
|
||||
o.Certificates = append(o.Certificates, *cert)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue