If VerifyConnection returns an error, the connection is terminated. If the connection is a resumption, there is no way for the callback to decide it would like the client to proceed to a full handshake, instead.
We could define a special error, tested with errors.Is, which causes the resumption to be rejected. In that case VerifyConnection can be called two or more times for a connection. (More if there are multiple session tickets.)
This is an issue and not a proposal for two reasons:
- we need to figure out if it's technically feasible to call VerifyConnection the first time while still in the handshake phase at which we choose whether to resume or not;
- we need to spec out a precise API.
Originally discussed at #77217 (comment).
(@espadolini pointed out that while we define smart errors for VerifyConnection, we could also make one that allows sending the peer a different TLS alert to close the connection.)
/cc @golang/security
If VerifyConnection returns an error, the connection is terminated. If the connection is a resumption, there is no way for the callback to decide it would like the client to proceed to a full handshake, instead.
We could define a special error, tested with errors.Is, which causes the resumption to be rejected. In that case VerifyConnection can be called two or more times for a connection. (More if there are multiple session tickets.)
This is an issue and not a proposal for two reasons:
Originally discussed at #77217 (comment).
(@espadolini pointed out that while we define smart errors for VerifyConnection, we could also make one that allows sending the peer a different TLS alert to close the connection.)
/cc @golang/security