Commit 7d2bdbb
authored
tls: Fix inbound I/O when TLS detection fails (#958)
When the proxy performs inbound TLS detection, it may break TLS streams
for application-terminated TLS connections.
Typically, inbound TLS detection does not actually need to buffer data
from the socket to determine the SNI value for a connection. However,
non-proxy clients may send enough ClientHello extensions such that
detection cannot be completed from a single peek of 512B. In this
situation, the proxy buffers data from the socket to determine the
SNI value, but it unfortunately does not preserve this buffered data as
it forward the connection.
This change updates the TLS detection logic to properly preserve any
data buffered from the socket in forwarded connections.1 parent fce8c4a commit 7d2bdbb
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | | - | |
| 256 | + | |
| 257 | + | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
| |||
0 commit comments