@marcel91200 / caddy Mirror · read-only / commits / 51106432
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

httpcaddyfile: Add key_type global option (#3231)

Francis Lavoie committed Apr 8, 2020 at 13:09 UTC 5110643201d6c82f0859f22d86be60c6493f69eb
2 files changed +7 -1
caddyconfig/httpcaddyfile/httptype.go
+2
@@ -307,6 +307,8 @@ func (ServerType) evaluateGlobalOptionsBlock(serverBlocks []serverBlock, options
307 val, err = parseOptOnDemand(disp)
308 case "local_certs":
309 val = true
310 + case "key_type":
311 + val, err = parseOptSingleString(disp)
312 default:
313 return nil, fmt.Errorf("unrecognized parameter name: %s", dir)
314 }
caddyconfig/httpcaddyfile/tlsapp.go
+5 -1
@@ -322,8 +322,9 @@ func newBaseAutomationPolicy(options map[string]interface{}, warnings []caddycon
322 acmeCARoot, hasACMECARoot := options["acme_ca_root"]
323 email, hasEmail := options["email"]
324 localCerts, hasLocalCerts := options["local_certs"]
325 + keyType, hasKeyType := options["key_type"]
326
326 - hasGlobalAutomationOpts := hasACMECA || hasACMEDNS || hasACMECARoot || hasEmail || hasLocalCerts
327 + hasGlobalAutomationOpts := hasACMECA || hasACMEDNS || hasACMECARoot || hasEmail || hasLocalCerts || hasKeyType
328
329 // if there are no global options related to automation policies
330 // set, then we can just return right away
@@ -363,6 +364,9 @@ func newBaseAutomationPolicy(options map[string]interface{}, warnings []caddycon
364 if acmeCARoot != nil {
365 mgr.TrustedRootsPEMFiles = []string{acmeCARoot.(string)}
366 }
367 + if keyType != nil {
368 + ap.KeyType = keyType.(string)
369 + }
370 ap.Issuer = mgr // we'll encode it later
371 }
372