BUG: Unexpected state while connecting to ... server, part 2 (#917)
These BUG messages (discussed and removed in a recent commit
2b6b1bc)
exposed several bugs. This change fixes a case where a BUG message was
triggered by the following Must() violation:
check failed: !csd->serverBump() ||
csd->serverBump()->at(...tlsBump1, XactionStep::tlsBump2)
exception location: PeekingPeerConnector.cc(173) initialize
The above Must() assumed that PeekingPeerConnector always changes the
SslBump step to step3. However, that assumption was wrong because
PeekingPeerConnector may run multiple times (and the step is recorded
outside the connector object). When FwdState reforwarded a failed
attempt, PeekingPeerConnector would find itself at step3.
Instead of fixing the Must(), we fixed a bigger bug: SslBump step3 must
start when we decide to communicate with the server, not in the middle
of that communication. This fix may affect some esoteric configurations
that use at_step ACLs outside ssl_bump _and_ rely on the wrong step
change timing, but, technically, such configurations are not officially
supported.
More step boundary fixes are needed. There is a (much bigger) ongoing
project dedicated to those changes.
This is a Measurement Factory project.