caddy/caddyconfig/httpcaddyfile
Matthew Holt 4217217bad
httpcaddyfile: Properly record whether we added catch-all conn policy
We recently introduced `if !cp.SettingsEmpty()` which conditionally
adds the connection policy to the list. If the condition evaluates to
false, the policy wouldn't actually be added, even if
hasCatchAllTLSConnPolicy was set to true on the previous line.

Now we set that variable in accordance with whether we actually add
the policy.

While debugging this I noticed that catch-all policies added early in
that loop (i.e. not at the end if we later determine we need one) are
not always at the end of the list. They should be, though, since they
are selected by which one matches first, and having a catch-all first
would nullify any more specific ones later in the list. So I added a
sort in consolidateConnPolicies to take care of that.

Should fix #3670 and
https://caddy.community/t/combining-on-demand-tls-with-custom-ssl-certs-doesnt-seem-to-work-in-2-1-1/9719
but I won't know for sure until somebody verifies it, since at least in
the GitHub issue there is not yet enough information (the configs are
redacted).
2020-09-11 13:45:21 -06:00
..
addresses.go httpcaddyfile: Don't lowercase placeholder contents (fixes #3264) 2020-04-14 16:11:46 -06:00
addresses_fuzz.go ci: fuzz: switch engine from libfuzzer to native go-fuzz (#3194) 2020-03-26 18:20:34 -06:00
addresses_test.go httpcaddyfile: Don't lowercase placeholder contents (fixes #3264) 2020-04-14 16:11:46 -06:00
builtins.go Update comment and Caddy 1 EOL 2020-08-11 11:26:19 -06:00
builtins_test.go httpcaddyfile: Be stricter about log syntax (#3419) 2020-05-15 15:57:16 -06:00
directives.go httpcaddyfile: Improve directive sorting logic (#3658) 2020-08-17 16:15:51 -06:00
directives_test.go tests: Clean up redundant type declarations 2020-04-10 08:48:21 -06:00
httptype.go httpcaddyfile: Properly record whether we added catch-all conn policy 2020-09-11 13:45:21 -06:00
httptype_test.go httpcaddyfile: Bring enforce_origin and origins to admin config (#3595) 2020-08-03 13:44:38 -06:00
options.go caddytls: Add support for ZeroSSL; add Caddyfile support for issuers (#3633) 2020-08-11 08:58:06 -06:00
tlsapp.go caddytls: Add support for ZeroSSL; add Caddyfile support for issuers (#3633) 2020-08-11 08:58:06 -06:00