summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-04-08 13:09:38 -0400
committerGitHub <noreply@github.com>2020-04-08 11:09:38 -0600
commit5110643201d6c82f0859f22d86be60c6493f69eb (patch)
treee7226edf7eb2500b6b3fc89f6723ee89e329c0a5
parent4d9b63d9097bd7bac46ecc06c292bf7c521fdcb6 (diff)
httpcaddyfile: Add key_type global option (#3231)
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go2
-rw-r--r--caddyconfig/httpcaddyfile/tlsapp.go6
2 files changed, 7 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 4e69895..a738166 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -307,6 +307,8 @@ func (ServerType) evaluateGlobalOptionsBlock(serverBlocks []serverBlock, options
val, err = parseOptOnDemand(disp)
case "local_certs":
val = true
+ case "key_type":
+ val, err = parseOptSingleString(disp)
default:
return nil, fmt.Errorf("unrecognized parameter name: %s", dir)
}
diff --git a/caddyconfig/httpcaddyfile/tlsapp.go b/caddyconfig/httpcaddyfile/tlsapp.go
index 1b7357c..2ce7ea3 100644
--- a/caddyconfig/httpcaddyfile/tlsapp.go
+++ b/caddyconfig/httpcaddyfile/tlsapp.go
@@ -322,8 +322,9 @@ func newBaseAutomationPolicy(options map[string]interface{}, warnings []caddycon
acmeCARoot, hasACMECARoot := options["acme_ca_root"]
email, hasEmail := options["email"]
localCerts, hasLocalCerts := options["local_certs"]
+ keyType, hasKeyType := options["key_type"]
- hasGlobalAutomationOpts := hasACMECA || hasACMEDNS || hasACMECARoot || hasEmail || hasLocalCerts
+ hasGlobalAutomationOpts := hasACMECA || hasACMEDNS || hasACMECARoot || hasEmail || hasLocalCerts || hasKeyType
// if there are no global options related to automation policies
// set, then we can just return right away
@@ -363,6 +364,9 @@ func newBaseAutomationPolicy(options map[string]interface{}, warnings []caddycon
if acmeCARoot != nil {
mgr.TrustedRootsPEMFiles = []string{acmeCARoot.(string)}
}
+ if keyType != nil {
+ ap.KeyType = keyType.(string)
+ }
ap.Issuer = mgr // we'll encode it later
}