Commit 886b6dd
Harden TCP listener: log Accept failures, bound ClientHello read
The wrapped TCP listeners (:443/:8443) were observed dying in production
while :80 and the UDP/QUIC paths kept running. The Accept-error path that
permanently stops the net/http server was silent, making the cause
undiagnosable. Now:
- Log the underlying Accept() error before propagating it.
- Set a 10s read deadline around the synchronous ClientHello capture so a
slow/silent client cannot wedge the Accept loop; clear it on success so
the TLS handshake is unaffected.
- Demote routine per-connection capture failures (non-TLS clients, port
scanners) from Error to Debug.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 5faad5c commit 886b6dd
1 file changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| |||
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
130 | 144 | | |
131 | 145 | | |
132 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
133 | 152 | | |
134 | 153 | | |
135 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
136 | 158 | | |
137 | 159 | | |
138 | 160 | | |
139 | 161 | | |
| 162 | + | |
| 163 | + | |
140 | 164 | | |
141 | 165 | | |
142 | 166 | | |
| |||
0 commit comments