mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
caddytls: Support placeholders in key_type (#3176)
* tls: Support placeholders in key_type * caddytls: Simplify placeholder support for ap.KeyType Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
7ee3ab7baa
commit
5c55e5d53f
1 changed files with 12 additions and 1 deletions
|
@ -183,8 +183,19 @@ func (ap *AutomationPolicy) Provision(tlsApp *TLS) error {
|
||||||
ap.Issuer = val.(certmagic.Issuer)
|
ap.Issuer = val.(certmagic.Issuer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
keyType := ap.KeyType
|
||||||
|
if keyType != "" {
|
||||||
|
var err error
|
||||||
|
keyType, err = caddy.NewReplacer().ReplaceOrErr(ap.KeyType, true, true)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("invalid key type %s: %s", ap.KeyType, err)
|
||||||
|
}
|
||||||
|
if _, ok := supportedCertKeyTypes[keyType]; !ok {
|
||||||
|
return fmt.Errorf("unrecognized key type: %s", keyType)
|
||||||
|
}
|
||||||
|
}
|
||||||
keySource := certmagic.StandardKeyGenerator{
|
keySource := certmagic.StandardKeyGenerator{
|
||||||
KeyType: supportedCertKeyTypes[ap.KeyType],
|
KeyType: supportedCertKeyTypes[keyType],
|
||||||
}
|
}
|
||||||
|
|
||||||
storage := ap.storage
|
storage := ap.storage
|
||||||
|
|
Loading…
Reference in a new issue