Skip to content

Commit 1c76ebc

Browse files
authored
Merge pull request #3141 from httpwg/bemasc-abrupt-tls
[connect-tcp] Improve recommendation for abrupt TLS termination
2 parents fee7219 + a3edc93 commit 1c76ebc

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

draft-ietf-httpbis-connect-tcp.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,13 @@ When closing connections, endpoints are subject to the following requirements:
168168
* When a TCP connection reaches the TIME-WAIT or CLOSED state, the associated endpoint MUST close its send stream.
169169
- If the connection closed gracefully, the endpoint MUST close the send stream gracefully.
170170
- Otherwise, the endpoint SHOULD close the send stream abruptly, using a mechanism appropriate to the HTTP version:
171-
- HTTP/3: RESET_STREAM with H3_CONNECT_ERROR
172-
- HTTP/2: RST_STREAM with CONNECT_ERROR
173-
- HTTP/1.1 over TLS: a TLS Error Alert
174-
- HTTP/1.1 (insecure): TCP RST.
171+
- HTTP/3: reset the stream with H3_CONNECT_ERROR;
172+
see {{!RFC9000, Section 19.4}} and {{?RFC9114, Section 8.1}}
173+
- HTTP/2: reset the stream with CONNECT_ERROR;
174+
see {{!RFC9113}}, Sections 6.4 and 7
175+
- HTTP/1.1 over TLS: TCP shutdown without a TLS closure alert;
176+
see {{!RFC8446, Section 6.1}}.
177+
- HTTP/1.1 without TLS: TCP RST
175178
* When the receive stream is closed abruptly or without a FINAL_DATA capsule received, the endpoint SHOULD send a TCP RST if the TCP subsystem permits it.
176179

177180
The mandatory behaviors above enable endpoints to detect any truncation of incoming TCP data. The recommended behaviors propagate any TCP errors through the proxy connection.
@@ -204,7 +207,7 @@ The mandatory behaviors above enable endpoints to detect any truncation of incom
204207
+-+-----+ +-+----------+ +----------+-+ +-----+-+
205208
+---"abc"--->+-------DATA{"abc"}------->+---"abc"--->|
206209
| | (... timeout @ A ...) | |
207-
| +--------TLS Alert-------->+----RST---->|
210+
| +--FIN (no close_notify)-->+----RST---->|
208211
| | | |
209212
~~~
210213
{: title="Timeout example (HTTP/1.1)"}
@@ -237,7 +240,7 @@ Servers that host a proxy under this specification MAY offer support for TLS ear
237240

238241
This specification supports the "Expect: 100-continue" request header ({{?RFC9110, Section 10.1.1}}) in any HTTP version. The "100 (Continue)" status code confirms receipt of a request at the proxy without waiting for the proxy-destination TCP handshake to succeed or fail. This might be particularly helpful when the destination host is not responding, as TCP handshakes can hang for several minutes before failing. Clients MAY send "Expect: 100-continue", and proxies MUST respect it by returning "100 (Continue)" if the request is not immediately rejected.
239242

240-
Proxies implementing this specification SHOULD include a "Proxy-Status" response header {{!RFC9209}} in any success or failure response (i.e., status codes 101, 2XX, 4XX, or 5XX) to support advanced client behaviors and diagnostics. In HTTP/2 or HTTP/3, proxies MAY additionally send a "Proxy-Status" trailer in the event of an unclean shutdown.
243+
Proxies implementing this specification SHOULD include a "Proxy-Status" response header {{!RFC9209}} in any success or failure response (i.e., status codes 101, 2XX, 4XX, or 5XX) to support advanced client behaviors and diagnostics. In HTTP/2 or HTTP/3, proxies MAY additionally send a "Proxy-Status" trailer in the event of an abrupt stream closure.
241244

242245
# Applicability
243246

@@ -291,7 +294,9 @@ A malicious client can achieve cause highly asymmetric resource usage at the pro
291294
While this specification is fully functional under HTTP/1.1, performance-sensitive deployments SHOULD use HTTP/2 or HTTP/3 instead. When using HTTP/1.1:
292295

293296
* Each CONNECT request requires a new TCP and TLS connection, imposing a higher cost in setup latency, congestion control convergence, CPU time, and data transfer.
294-
* It may be difficult to implement the recommended unclean shutdown signals ({{closing-connections}}), as many TLS libraries do not support injecting TLS Alerts.
297+
* The graceful and abrupt closure signals ({{closing-connections}}) are more likely to be missing or corrupted:
298+
- Some implementations may be unable to emit the recommended abrupt closure signals, due to limitations in their TCP and TLS subsystems.
299+
- Faulty implementations may fail to send a TLS closure alert during graceful shutdown, or fail to report an error when the expected closure alert is not received. These misbehaviors are not compliant with {{RFC8446}}, but they are common nonetheless among HTTP/1.1 implementations today.
295300
* The number of active connections through each client may be limited by the number of available TCP client ports, especially if:
296301
- The client only has one IP address that can be used to reach the proxy.
297302
- The client is shared between many parties, such as when acting as a gateway or concentrator.

0 commit comments

Comments
 (0)