Skip to content

Commit

Permalink
tls: wildcard catch-all cert must be at the end of cert list (#4119)
Browse files Browse the repository at this point in the history
  • Loading branch information
wasaga committed Apr 21, 2023
1 parent 681cf6f commit 34c1e44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@
.*.yaml
.*.json
.*.rego
*.jq
pem
env
coverage.txt
Expand Down
4 changes: 1 addition & 3 deletions config/envoyconfig/listeners.go
Expand Up @@ -114,9 +114,7 @@ func getAllCertificates(cfg *config.Config) ([]tls.Certificate, error) {
return nil, fmt.Errorf("error getting wildcard certificate: %w", err)
}

// wildcard certificate must be first so that it is used as the default certificate
// when no SNI matches
return append([]tls.Certificate{*wc}, allCertificates...), nil
return append(allCertificates, *wc), nil
}

func (b *Builder) buildTLSSocket(ctx context.Context, cfg *config.Config, certs []tls.Certificate) (*envoy_config_core_v3.TransportSocket, error) {
Expand Down

0 comments on commit 34c1e44

Please sign in to comment.