Do I have to always call Accept or Reject in the certificate handler?

0 votes
asked Oct 2, 2017 by Uwe Keim (1,070 points)
edited Oct 2, 2017 by Uwe Keim

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)

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
answered Oct 2, 2017 by stepantalalayev (3,940 points)
edited Oct 2, 2017 by Lukas Pokorny
Best answer


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).

commented Oct 2, 2017 by Uwe Keim (1,070 points)
Thanks a lot! That is exactly the behaviour I would have expected and was looking for.