private bool CompleteHandshake(ref ProtocolToken alertToken)
{
if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
Context.ProcessHandshakeSuccess();
if (!Context.VerifyRemoteCertificate(_certValidationDelegate, ref alertToken))
{
_handshakeCompleted = false;
_certValidationFailed = true;
if (NetEventSource.IsEnabled) NetEventSource.Exit(this, false);
return false;
}
_certValidationFailed = false;
_handshakeCompleted = true;
if (NetEventSource.IsEnabled) NetEventSource.Exit(this, true);
return true;
}