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
If the gRPC client connects to an HTTP/1.1 server, either because we're using HTTP/2 over plain text (h2c), or because the server doesn't support ALPN and the gRPC client still doesn't fail in that case, it would be nice if the client could give a nicer error message than error reading server preface: http2: frame too large.
Detecting that the server is an HTTP/1.1 server is actually trivial, the HTTP/2 preface looks like a valid HTTP request with an unknown method, so HTTP/1.1 servers will usually respond to HTTP/2 requests with:
HTTP/1.1 405 Method Not Allowed
An HTTP/2 client expects the first three bytes sent in the stream, ie HTT, to be the length of the HTTP/2 settings frame. So, it will read HTT as the number 0x485454, which is around 4.7mb, and fail with the above mentioned error. What can be done is special case the value of 0x485454, and generate a different error message, eg error reading server preface: http2: frame too large - possible HTTP/1.1 server.
The text was updated successfully, but these errors were encountered:
If anyone is looking to contribute, the other bug report that I linked to I think is far more important than this issue to fix, and the fix is somewhat simple:
If the gRPC client connects to an HTTP/1.1 server, either because we're using HTTP/2 over plain text (h2c), or because the server doesn't support ALPN and the gRPC client still doesn't fail in that case, it would be nice if the client could give a nicer error message than
error reading server preface: http2: frame too large
.Detecting that the server is an HTTP/1.1 server is actually trivial, the HTTP/2 preface looks like a valid HTTP request with an unknown method, so HTTP/1.1 servers will usually respond to HTTP/2 requests with:
An HTTP/2 client expects the first three bytes sent in the stream, ie
HTT
, to be the length of the HTTP/2 settings frame. So, it will readHTT
as the number 0x485454, which is around 4.7mb, and fail with the above mentioned error. What can be done is special case the value of 0x485454, and generate a different error message, egerror reading server preface: http2: frame too large - possible HTTP/1.1 server
.The text was updated successfully, but these errors were encountered: