@marcel91200 / caddy Mirror · read-only / commits / 95af4262
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

caddytls: Support ACME alt cert chain preferences

Matthew Holt committed Nov 12, 2020 at 15:02 UTC 95af4262a8adf12e0c5eb178d9e521903eb8b0e4
3 files changed +9 -3
go.mod
+1 -1
@@ -6,7 +6,7 @@ require (
6 github.com/Masterminds/sprig/v3 v3.1.0
7 github.com/alecthomas/chroma v0.8.0
8 github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a
9 - github.com/caddyserver/certmagic v0.12.1-0.20201021150819-90d1550af48c
9 + github.com/caddyserver/certmagic v0.12.1-0.20201112220015-12df2be5a021
10 github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
11 github.com/go-chi/chi v4.1.2+incompatible
12 github.com/google/cel-go v0.5.1
go.sum
+2 -2
@@ -85,8 +85,8 @@ github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTK
85 github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
86 github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
87 github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
88 -github.com/caddyserver/certmagic v0.12.1-0.20201021150819-90d1550af48c h1:IvUz1LXmHL2y3UVGbzmnvz5/2CA1rvurJA/AL4reKKI=
89 -github.com/caddyserver/certmagic v0.12.1-0.20201021150819-90d1550af48c/go.mod h1:tr26xh+9fY5dN0J6IPAlMj07qpog22PJKa7Nw7j835U=
88 +github.com/caddyserver/certmagic v0.12.1-0.20201112220015-12df2be5a021 h1:VY4JahIicW/GT84KoIm+TSKwMHj08NyPJhsGypTWJn4=
89 +github.com/caddyserver/certmagic v0.12.1-0.20201112220015-12df2be5a021/go.mod h1:tr26xh+9fY5dN0J6IPAlMj07qpog22PJKa7Nw7j835U=
90 github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
91 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
92 github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
modules/caddytls/acmeissuer.go
+6
@@ -74,6 +74,11 @@ type ACMEIssuer struct {
74 // is internal or for development/testing purposes.
75 TrustedRootsPEMFiles []string `json:"trusted_roots_pem_files,omitempty"`
76
77 + // List of preferred certificate chains, by issuer's CommonName. If empty,
78 + // or if no matching chain is found, the first chain offered by the server
79 + // will be used.
80 + PreferredChains []string `json:"preferred_chains,omitempty"`
81 +
82 rootPool *x509.CertPool
83 template certmagic.ACMEManager
84 magic *certmagic.Config
@@ -149,6 +154,7 @@ func (iss *ACMEIssuer) makeIssuerTemplate() (certmagic.ACMEManager, error) {
154 CertObtainTimeout: time.Duration(iss.ACMETimeout),
155 TrustedRoots: iss.rootPool,
156 ExternalAccount: iss.ExternalAccount,
157 + PreferredChains: iss.PreferredChains,
158 Logger: iss.logger,
159 }
160