Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start an HTTP/2 server with gin without providing ssl certificates #1116

Closed
aditya101kumar opened this issue Sep 22, 2017 · 7 comments
Closed
Labels

Comments

@aditya101kumar
Copy link

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 .

@thinkerou
Copy link
Member

thinkerou commented Sep 22, 2017

Maybe the example can help you.

@saratchandra132
Copy link

saratchandra132 commented Sep 22, 2017

That did`nt help as it uses TLS for HTTP2 instead is there a way we use TCP implementation for HTTP2 in gin?

@BastianM3
Copy link

We need this too. We're doing ssl termination at the ALB level in AWS.

@thinkerou
Copy link
Member

@kishaningithub
Copy link

kishaningithub commented Aug 4, 2021

@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/

@kishaningithub
Copy link

I hope this PR gets merged to support this

#1398

@appleboy
Copy link
Member

#1398 already merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants