Skip to content

x/net/http2: error message is unclear when connecting to an http 1.x server #35724

@jingyugao

Description

@jingyugao

What version of Go are you using (go version)?

1.13

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"

What did you do?

https://play.studygolang.com/p/_1kMO-E_FEq
I use an http2 client try to connect an http client.

I expect to see an protocol error or somethig that can tell me the destination is not a valiad http2 service.

What did you see instead?

I get an "unexpected EOF" error.
I think we can make the error more clearly.

According to the rfc, the last segment of [https://httpwg.org/specs/rfc7540.html#rfc.section.3.5]

Clients and servers MUST treat an invalid connection preface as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.

It seems we should return PROTOCOL_ERROR

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions