1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00
caddy/caddyconfig/httpcaddyfile
Matthew Holt 97ed9e111d
httpcaddyfile: Add nil check to prevent panic, fix validation logic
Panic would happen if an automation policy was specified in a singular
server block that had no hostnames in its address. Definitely an edge
case.

Fixed a bug related to checking for server blocks with a host-less key
that tried to make an automation policy. Previously if you had only two
server blocks like ":443" and another one at ":80", the one at ":443"
could not create a TLS automation policy because it thought it would
interfere with TLS automation for the block at ":80", but obviously that
key doesn't enable TLS because it is on the HTTP port. So now we are a
little smarter and count only non-HTTP-empty-hostname keys.

Also fixed a bug so that a key like "https://:1234" is sure to have TLS
enabled by giving it a TLS connection policy. (Relaxed conditions
slightly; the previous conditions were too strict, requiring there to be
a TLS conn policy already or a default SNI to be non-empty.)

Also clarified a comment thanks to feedback from @Mohammed90
2020-04-24 20:57:51 -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 caddytls: Refactor certificate selection policies (close #1575) 2020-04-01 20:49:35 -06:00
directives.go httpcaddyfile, caddytls: Multiple edge case fixes; add tests 2020-04-08 14:46:44 -06:00
directives_test.go tests: Clean up redundant type declarations 2020-04-10 08:48:21 -06:00
httptype.go httpcaddyfile: Add nil check to prevent panic, fix validation logic 2020-04-24 20:57:51 -06:00
httptype_test.go caddyhttp: Support single-line not matcher (#3228) 2020-04-06 13:05:49 -06:00
options.go httpcaddyfile: Many tls-related improvements including on-demand support 2020-03-17 21:00:45 -06:00
tlsapp.go httpcaddyfile: Add nil check to prevent panic, fix validation logic 2020-04-24 20:57:51 -06:00