mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-01 07:50:26 +02:00
cryptutil: generate certificates from deriveca
This commit is contained in:
parent
b13afc7b0c
commit
91fca06397
8 changed files with 28 additions and 62 deletions
|
@ -185,8 +185,13 @@ func (cfg *Config) GetCertificateForServerName(serverName string) (*tls.Certific
|
|||
return &cert, nil
|
||||
}
|
||||
|
||||
sharedKey, err := cfg.Options.GetSharedKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate cert, invalid shared key: %w", err)
|
||||
}
|
||||
|
||||
// finally fall back to a generated, self-signed certificate
|
||||
return cryptutil.GenerateSelfSignedCertificate(serverName)
|
||||
return cryptutil.GenerateCertificate(sharedKey, serverName)
|
||||
}
|
||||
|
||||
// WillHaveCertificateForServerName returns true if there will be a certificate for the given server name.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue