openssl
openssl copied to clipboard
http2 enabling
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!
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.
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