Skip to content

Commit

Permalink
fix(server): accept HTTP/1.1 for backward compatibility (#20639)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Gaudreault <[email protected]>
Co-authored-by: Michael Crenshaw <[email protected]>
  • Loading branch information
agaudreault and crenshaw-dev authored Nov 4, 2024
1 parent 16649c6 commit a68d057
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,11 @@ func (a *ArgoCDServer) Run(ctx context.Context, listeners *Listeners) {
// If not matched, we assume that its TLS.
tlsl := tcpm.Match(cmux.Any())
tlsConfig := tls.Config{
NextProtos: []string{"h2"},
// Advertise that we support both http/1.1 and http2 for application level communication.
// By putting http/1.1 first, we ensure that HTTPS clients will use http/1.1, which is the only
// protocol our server supports for HTTPS clients. By including h2 in the list, we ensure that
// gRPC clients know we support http2 for their communication.
NextProtos: []string{"http/1.1", "h2"},
}
tlsConfig.GetCertificate = func(info *tls.ClientHelloInfo) (*tls.Certificate, error) {
return a.settings.Certificate, nil
Expand Down

0 comments on commit a68d057

Please sign in to comment.