From 748bd91dbea08a07e9c01524b657b843f09602e6 Mon Sep 17 00:00:00 2001 From: Merten van Gerven Date: Mon, 12 Oct 2015 14:23:32 +0200 Subject: [PATCH] Added workaround for default enabled HTTP2 configuration --- recipes/graceful-shutdown/grace/server.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/graceful-shutdown/grace/server.go b/recipes/graceful-shutdown/grace/server.go index 9dbeb7d4..da3dc0b7 100644 --- a/recipes/graceful-shutdown/grace/server.go +++ b/recipes/graceful-shutdown/grace/server.go @@ -14,5 +14,14 @@ func main() { return c.String(http.StatusOK, "Six sick bricks tick") }) - gracehttp.Serve(e.Server(":1323")) + // Get the http.Server + s := e.Server(":1323") + + // HTTP2 is currently enabled by default in echo.New(). To override TLS handshake errors + // you will need to override the TLSConfig for the server so it does not attempt to valudate + // the connection using TLS as required by HTTP2 + s.TLSConfig = nil + + // Serve it like a boss + gracehttp.Serve(s) }