caddy/modules/caddytls
Matthew Holt 6ca5828221
caddytls: Refactor certificate selection policies (close #1575)
Certificate selection used to be a module, but this seems unnecessary,
especially since the built-in CustomSelectionPolicy allows quite complex
selection logic on a number of fields in certs. If we need to extend
that logic, we can, but I don't think there are SO many possibilities
that we need modules.

This update also allows certificate selection to choose between multiple
matching certs based on client compatibility and makes a number of other
improvements in the default cert selection logic, both here and in the
latest CertMagic.

The hardest part of this was the conn policy consolidation logic
(Caddyfile only, of course). We have to merge connection policies that
we can easily combine, because if two certs are manually loaded in a
Caddyfile site block, that produces two connection policies, and each
cert is tagged with a different tag, meaning only the first would ever
be selected. So given the same matchers, we can merge the two, but this
required improving the Tag selection logic to support multiple tags to
choose from, hence "tags" changed to "any_tag" or "all_tags" (but we
use any_tag in our Caddyfile logic).

Combining conn policies with conflicting settings is impossible, so
that should return an error if two policies with the exact same matchers
have non-empty settings that are not the same (the one exception being
any_tag which we can merge because the logic for them is to OR them).

It was a bit complicated. It seems to work in numerous tests I've
conducted, but we'll see how it pans out in the release candidates.
2020-04-01 20:49:35 -06:00
..
distributedstek Refactor for CertMagic v0.10; prepare for PKI app 2020-03-06 23:15:25 -07:00
standardstek v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924) 2019-12-10 13:36:46 -07:00
acmeissuer.go caddytls: Add support for externalAccountBinding ACME extension 2020-03-31 21:08:02 -06:00
automation.go caddytls: Remove ManageSync 2020-03-26 14:02:29 -06:00
certselection.go caddytls: Refactor certificate selection policies (close #1575) 2020-04-01 20:49:35 -06:00
connpolicy.go caddytls: Refactor certificate selection policies (close #1575) 2020-04-01 20:49:35 -06:00
fileloader.go v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924) 2019-12-10 13:36:46 -07:00
folderloader.go v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924) 2019-12-10 13:36:46 -07:00
internalissuer.go v2: Implement 'pki' app powered by Smallstep for localhost certificates (#3125) 2020-03-13 11:06:08 -06:00
matchers.go caddytls: Match automation policies by wildcard subjects too 2020-03-26 14:01:38 -06:00
matchers_test.go caddytls: Support wildcard matching in ServerName conn policy matcher 2020-03-20 15:51:37 -06:00
pemloader.go v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924) 2019-12-10 13:36:46 -07:00
sessiontickets.go v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924) 2019-12-10 13:36:46 -07:00
tls.go caddytls: Remove ManageSync 2020-03-26 14:02:29 -06:00
values.go caddytls: Update cipher suite names and curve names 2020-04-01 14:09:29 -06:00