mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
httpcaddyfile: Support explicitly turning off strict_sni_host
(#4592)
This commit is contained in:
parent
ac14b64e08
commit
5bd96a6ac2
2 changed files with 17 additions and 6 deletions
|
@ -157,11 +157,14 @@ func unmarshalCaddyfileServerOptions(d *caddyfile.Dispenser) (interface{}, error
|
|||
serverOpts.ExperimentalHTTP3 = true
|
||||
|
||||
case "strict_sni_host":
|
||||
if d.NextArg() {
|
||||
return nil, d.ArgErr()
|
||||
if d.NextArg() && d.Val() != "insecure_off" && d.Val() != "on" {
|
||||
return nil, d.Errf("strict_sni_host only supports 'on' or 'insecure_off', got '%s'", d.Val())
|
||||
}
|
||||
trueBool := true
|
||||
serverOpts.StrictSNIHost = &trueBool
|
||||
boolVal := true
|
||||
if d.Val() == "insecure_off" {
|
||||
boolVal = false
|
||||
}
|
||||
serverOpts.StrictSNIHost = &boolVal
|
||||
|
||||
default:
|
||||
return nil, d.Errf("unrecognized protocol option '%s'", d.Val())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue