From b94b2d647d1efe979a909e38914d348189a706ae Mon Sep 17 00:00:00 2001 From: Chitoku Date: Fri, 26 Nov 2021 07:19:44 +0900 Subject: [PATCH] Fix a bug where HTTP 2 connections were not working (#72) Signed-off-by: Chitoku --- web/tls_config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/tls_config.go b/web/tls_config.go index 2668964a..328c5e0e 100644 --- a/web/tls_config.go +++ b/web/tls_config.go @@ -240,7 +240,12 @@ func Serve(l net.Listener, server *http.Server, tlsConfigPath string, logger log // Set the GetConfigForClient method of the HTTPS server so that the config // and certs are reloaded on new connections. server.TLSConfig.GetConfigForClient = func(*tls.ClientHelloInfo) (*tls.Config, error) { - return getTLSConfig(tlsConfigPath) + config, err := getTLSConfig(tlsConfigPath) + if err != nil { + return nil, err + } + config.NextProtos = server.TLSConfig.NextProtos + return config, nil } return server.ServeTLS(l, "", "") }