mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
node: disable http2 for auth API
This commit is contained in:
parent
723aae2b4e
commit
976ee370c3
2 changed files with 8 additions and 1 deletions
|
|
@ -152,8 +152,10 @@ func New(conf *Config) (*Node, error) {
|
||||||
// Configure RPC servers.
|
// Configure RPC servers.
|
||||||
node.http = newHTTPServer(node.log, conf.HTTPTimeouts)
|
node.http = newHTTPServer(node.log, conf.HTTPTimeouts)
|
||||||
node.httpAuth = newHTTPServer(node.log, conf.HTTPTimeouts)
|
node.httpAuth = newHTTPServer(node.log, conf.HTTPTimeouts)
|
||||||
|
node.httpAuth.disableHTTP2 = true // Engine API does not need HTTP/2
|
||||||
node.ws = newHTTPServer(node.log, rpc.DefaultHTTPTimeouts)
|
node.ws = newHTTPServer(node.log, rpc.DefaultHTTPTimeouts)
|
||||||
node.wsAuth = newHTTPServer(node.log, rpc.DefaultHTTPTimeouts)
|
node.wsAuth = newHTTPServer(node.log, rpc.DefaultHTTPTimeouts)
|
||||||
|
node.wsAuth.disableHTTP2 = true
|
||||||
node.ipc = newIPCServer(node.log, conf.IPCEndpoint())
|
node.ipc = newIPCServer(node.log, conf.IPCEndpoint())
|
||||||
|
|
||||||
return node, nil
|
return node, nil
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,9 @@ type httpServer struct {
|
||||||
port int
|
port int
|
||||||
|
|
||||||
handlerNames map[string]string
|
handlerNames map[string]string
|
||||||
|
|
||||||
|
// disableHTTP2 disables HTTP/2 support on this server when set to true.
|
||||||
|
disableHTTP2 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -140,7 +143,9 @@ func (h *httpServer) start() error {
|
||||||
h.server = &http.Server{Handler: h}
|
h.server = &http.Server{Handler: h}
|
||||||
h.server.Protocols = new(http.Protocols)
|
h.server.Protocols = new(http.Protocols)
|
||||||
h.server.Protocols.SetHTTP1(true)
|
h.server.Protocols.SetHTTP1(true)
|
||||||
|
if !h.disableHTTP2 {
|
||||||
h.server.Protocols.SetUnencryptedHTTP2(true)
|
h.server.Protocols.SetUnencryptedHTTP2(true)
|
||||||
|
}
|
||||||
if h.timeouts != (rpc.HTTPTimeouts{}) {
|
if h.timeouts != (rpc.HTTPTimeouts{}) {
|
||||||
CheckTimeouts(&h.timeouts)
|
CheckTimeouts(&h.timeouts)
|
||||||
h.server.ReadTimeout = h.timeouts.ReadTimeout
|
h.server.ReadTimeout = h.timeouts.ReadTimeout
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue