var port = “8080” func main() { mainRouter := gin.Default() mainRouter.GET("/ping", func(c gin.Context) { c.JSON(200, gin.H{ "message": "pong", }) }) mainRouter.RunTLS(":"+port, "server.pem", "server.key")* }
Is it necessary to provide server.pem and server.key to start a tls server , Cant this ssl check can be done at Load Balancer level which resides on the top of gin server ?
I want my application to be independent of the ssl check , is this possible to start server without providing certificate like mainRouter.RunTLS(":"+port)
Purpose - i need to serve http2 request with gin .
Comment From: thinkerou
Maybe the example can help you.
Comment From: saratchandra132
That did`nt help as it uses TLS for HTTP2 instead is there a way we use TCP implementation for HTTP2 in gin?
Comment From: BastianM3
We need this too. We're doing ssl termination at the ALB level in AWS.
Comment From: thinkerou
@BastianM3 https://github.com/gin-gonic/gin/tree/master/examples/auto-tls can help you?
Comment From: kishaningithub
@thinkerou the above auto-tls link should be updated to https://github.com/gin-gonic/examples/tree/master/auto-tls
Also what do you think about adding HTTP2 without TLS (H2C) support like the following
https://github.com/thrawn01/h2c-golang-example/blob/master/cmd/server/main.go
Associated blog - https://www.mailgun.com/blog/http-2-cleartext-h2c-client-example-go/
Comment From: kishaningithub
I hope this PR gets merged to support this
https://github.com/gin-gonic/gin/pull/1398
Comment From: appleboy