AdguardTeam / gomitmproxy

Simple golang mitm proxy implementation
https://adguard.com/
GNU General Public License v3.0
273 stars 53 forks source link

may cause connection hang #14

Closed xxxsen closed 6 months ago

xxxsen commented 1 year ago

https://github.com/AdguardTeam/gomitmproxy/blob/8a052425e2d0fd70b17d278befadbfd8b5affc68/proxy.go#L549

consider this case.

  1. user use mitm server to proxy ssh traffic(or any other unmitmable traffic)
  2. mitm server determined that dont need mitm and go into copy tunnel logic
  3. client begin sending handshake info but client crash abnomally

in this case, client=>mitm connection will be close but mitm => ssh server connection will be hang forever(ssh server still wait for reading handshake info, they dont know that client had already close the connection).