Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 CONNECT does not return CONNECT_ERROR on upstream RST #13055

Closed
mhoran opened this issue Sep 11, 2020 · 1 comment · Fixed by #13519
Closed

HTTP/2 CONNECT does not return CONNECT_ERROR on upstream RST #13055

mhoran opened this issue Sep 11, 2020 · 1 comment · Fixed by #13519
Assignees

Comments

@mhoran
Copy link

mhoran commented Sep 11, 2020

Title: HTTP/2 CONNECT does not return CONNECT_ERROR on upstream RST

Description:
I've have a downstream proxy that tunnels TCP via HTTP/2 to a backend service. Envoy is in front of the service and provides an HTTP/2 endpoint which supports the CONNECT method. The backend (Envoy upstream) service sometimes shuts down a connection by sending a TCP RST. According to the HTTP/2 spec, "[a] proxy treats any error in the TCP connection, which includes receiving a TCP segment with the RST bit set, as a stream error [...] of type CONNECT_ERROR." While Envoy does send RST_STREAM, the error is NO_ERROR instead of CONNECT_ERROR.

The spec goes on to state that any error (stream or connection) must result in a TCP RST being sent to downstream clients, so I can work around this. However, I wanted to check if this was intended behavior.

Repro steps:
This is reproducible with Envoy v1.15.0 configured with support for HTTP/2 CONNECT as per https://github.com/envoyproxy/envoy/blob/master/configs/terminate_connect.v3.yaml (substituting the upstream socket_address as appropriate). My upstream service is MySQL. I can likely set up a more easily reproducible example if needed.

When the upstream service sends a TCP RST (in the case of MySQL, after there is no authentication within 10 seconds of connect by default), then Envoy will send RST_STREAM with NO_ERROR as the error. However, this error should be set to CONNECT_ERROR as per the spec.

Config:
https://github.com/envoyproxy/envoy/blob/master/configs/terminate_connect.v3.yaml

Logs:
Logs indicate a success (200).

@mhoran mhoran added bug triage Issue requires triage labels Sep 11, 2020
@mattklein123
Copy link
Member

Thanks for raising this. Agreed this is a bug and we can fix. cc @alyssawilk

@mattklein123 mattklein123 added area/http help wanted Needs help! and removed triage Issue requires triage labels Sep 11, 2020
@alyssawilk alyssawilk self-assigned this Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants