Commit 0801680
committed
Never pool a socket whose CONNECT the proxy refused
Motivation:
A refused CONNECT leaves a plaintext hop to the proxy. The status check in
HttpHandler closes it on the ordinary path, but response filters run ahead of
that check, so a ResponseFilter asking for a replay - an everyday retry
pattern - short-circuits the interceptor chain and the socket reaches the
pool. The next exchange for that origin then polls it back and writes the
origin request, Authorization included, down a hop the proxy is still reading
in the clear. The 2.x line already guards this at the pool boundary; 3.x did
not.
Modification:
Refuse to pool a channel whose exchange still carries a CONNECT. A CONNECT
the proxy accepted is consumed by ConnectSuccessInterceptor, which takes the
channel over, so a CONNECT still on the future here means the tunnel was
never built. Sampled where keepAlive and the partition key are sampled,
because callers hand the drain over and immediately move the future on to the
next request.
Result:
A refused-CONNECT socket is closed rather than pooled, on the filter-replay
path as well as the ordinary one, matching 2.16.1.1 parent d1f45ab commit 0801680
2 files changed
Lines changed: 40 additions & 2 deletions
File tree
- client/src/main/java/org/asynchttpclient/netty
- channel
- handler
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
447 | 449 | | |
448 | 450 | | |
449 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
450 | 482 | | |
451 | 483 | | |
452 | 484 | | |
| |||
1172 | 1204 | | |
1173 | 1205 | | |
1174 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
1175 | 1213 | | |
1176 | 1214 | | |
1177 | 1215 | | |
1178 | | - | |
| 1216 | + | |
1179 | 1217 | | |
1180 | 1218 | | |
1181 | 1219 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments