]> 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)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 21 May 2020 22:22:28 +0000 (22:22 +0000)
commit25b0ce453c0bca4bf15786bfe912967cb021e2b9
tree1f7294aa20664cd4eec413c5d4508bc33e21470e
parent614bd51130b0f7032ed2b8927bed1d73dc87956b
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