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

http2 enabling #70

Open
yonderblue opened this issue Feb 15, 2017 · 2 comments
Open

http2 enabling #70

yonderblue opened this issue Feb 15, 2017 · 2 comments

Comments

@yonderblue
Copy link

yonderblue commented Feb 15, 2017

I can't seem to get a server that is run with server := &http.Server{...}; server.Serve(theOpensslListener) to serve http2. I've tried setting TLSNextProto to nil and to call http2.ConfigureServer etc, which works when not going through openssl's listener. Any suggestions? Thanks!

@zeebo
Copy link
Member

zeebo commented Mar 3, 2017

The go http2 implementation is heavily tied to using crypto/tls to read the ALNP business in the handshake unfortunately. You have to figure out a way to serve http2 over bare connections and handle wrapping the connections with our openssl library yourself. :(

I'll leave this open to track possibly making a helper in some package to make this easier.

@yonderblue
Copy link
Author

Looks like this should be entirely possible by supporting on the Ctx in here the ability to set a callback to select the proto from the ones the client gives in ALPN, then once a conn is in hand from a listener, choose to do http2.Server.ServeConn or feed to a running http.Server's listener depending on what proto client chose on conn.

https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_alpn_select_cb.html

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

No branches or pull requests

2 participants