You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 6, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 6, 2018. It is now read-only.
a better default configuration for TLS connection of http2 #59
It seems the TLS socket is initialized as tls.connect(port, host, options) in http2.connect. Some existing HTTP2 servers require some TLS options to set up the connection properly. More specifically:
servername (for Server Name Indication)
ALPN / NPN, specifying 'h2'
I believe those should be set by defaults, then passing a URL string will just work.
Also, maybe it's better to use secureConnect event instead of connect event for the TLS sockets for setting up a session -- so that it won't go into the session if some TLS setup failure happens.
The ALPN/NPN bit should already be handled internally by the code. If it's not, then that's definitely a bug. For the SNI, that should be able to be passed in on the options but I haven't tested it yet.
SNI can be specified through options indeed, but (for the clients) I think it's better to specify the host name by default, otherwise an http2 connection request will look like http2.connect("https://http2.golang.org/", {servername: 'http2.golang.org'}) which are really redundant.
It seems the TLS socket is initialized as
tls.connect(port, host, options)inhttp2.connect. Some existing HTTP2 servers require some TLS options to set up the connection properly. More specifically:I believe those should be set by defaults, then passing a URL string will just work.
Also, maybe it's better to use
secureConnectevent instead ofconnectevent for the TLS sockets for setting up a session -- so that it won't go into the session if some TLS setup failure happens.