Skip to content

Commit

Permalink
httpcaddyfile: Sort TLS SNI matcher for deterministic JSON output (#5860
Browse files Browse the repository at this point in the history
)

* httpcaddyfile: Sort TLS SNI matcher, for deterministic adapt output

* Update caddyconfig/httpcaddyfile/httptype.go

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
  • Loading branch information
francislavoie and mholt committed Oct 11, 2023
1 parent 9c419f1 commit 33d8d2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions caddyconfig/httpcaddyfile/httptype.go
Expand Up @@ -685,6 +685,7 @@ func (st *ServerType) serversFromPairings(
}

if len(hosts) > 0 {
slices.Sort(hosts) // for deterministic JSON output
cp.MatchersRaw = caddy.ModuleMap{
"sni": caddyconfig.JSON(hosts, warnings), // make sure to match all hosts, not just auto-HTTPS-qualified ones
}
Expand Down

0 comments on commit 33d8d2c

Please sign in to comment.