0 votes
by (1.2k points)
edited by

When it comes to Custom certificate validation, I see all the examples that either call Accept or Recect in all execution branches.

My question is, whether this code is valid, too:

private void ftp_ValidatingCertificate(
    object sender, 
    SslCertificateValidationEventArgs e)
{
    if (IgnoreCertificateErrors)
    {
        e.Accept();
    }
}

I.e. I only call Accept under certain cases, but sometimes I do call neither Accept nor Reject.

Is this allowed?

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
by (3.9k points)
edited by
 
Best answer

Hello,

After a little research on your question I have found that program will continue working without any exception thrown. If none of the events calls either Accept or Reject, the library will behave as if there were no ValidatingCertificate at all (it will use the built-in certificate validator).

by (1.2k points)
Thanks a lot! That is exactly the behaviour I would have expected and was looking for.
...