]> git.ipfire.org Git - thirdparty/squid.git/commit
Detail TLS and CONNECT cache_peer negotiation failures (#518)
authorChristos Tsantilas <christos@chtsanti.net>
Thu, 21 May 2020 22:22:22 +0000 (22:22 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 24 May 2020 06:54:07 +0000 (18:54 +1200)
commit8eece637e89fcb3276ec5ba5b481c7a63fca54c2
treef8f8c2bcb1a7eb411cc209c1db6e265745da58fb
parent40ba7530d7d60bfb09c37049ac7593d73120f2d4
Detail TLS and CONNECT cache_peer negotiation failures (#518)

Before PeerConnector and Tunneler were introduced, FwdState and
TunnelStateData naturally owned their to-server connection. When CONNECT
and TLS negotiation were outsourced, we kept that ownership to minimize
changes and simplify negotiation code. That was wrong because FwdState
and TunnelStateData, as connection owners, had to monitor for connection
closures but could not distinguish basic TCP peer closures from complex
CONNECT/TLS negotiation failures that required further detailing. The
user got generic error messages instead of details known to negotiators.

Now, Ssl::PeerConnector and Http::Tunneler jobs own the connection they
work with and, hence, are responsible for monitoring it and, upon
successful negotiation, returning it to the initiators. In case of
problems, these jobs send detailed errors to the initiators instead.

Passing connection ownership to and from a helper job is difficult
because the connection may be either closed or begin to close (e.g. by
shutdown) while the callback is pending without working close handlers.
Many changes focus on keeping Connection::fd in sync with Comm.

Also improved tunnel.cc mimicking of (better) FwdState code: Partially
open connections after Comm::ConnOpener failures are now closed, and
Http::Tunneler failures are now retried.

This is a Measurement Factory project.
12 files changed:
src/FwdState.cc
src/FwdState.h
src/clients/HttpTunneler.cc
src/clients/HttpTunneler.h
src/clients/HttpTunnelerAnswer.cc
src/clients/HttpTunnelerAnswer.h
src/security/BlindPeerConnector.cc
src/security/PeerConnector.cc
src/security/PeerConnector.h
src/ssl/PeekingPeerConnector.cc
src/tests/stub_libsecurity.cc
src/tunnel.cc