8

HttpWebRequest.ServerCertificateValidationCallback allows you to override the logic for server certificate validation when using HTTPS.

There is no equivalent property on FtpWebRequest.

How can I override server certificate validation when using FtpWebRequest?

I am aware of ServicePointManager.ServerCertificateValidationCallback, but am looking for a solution that will only affect the current FtpWebRequest object.

Ergwun
  • 12,579
  • 7
  • 56
  • 83
  • Here contains one method for only affecting the current request. https://forums.asp.net/t/1455005.aspx?Accept+all+certificates+using+FTP+SSL+ – Anthony McGrath Jun 20 '18 at 12:43
  • @AnthonyMcGrath While the code you linked to immediately reverts the `ServicePointManager.ServerCertificateValidationCallback` after use, it will still affect other concurrent requests, even ones made via other instances of `FtpWebRequest`. – Ergwun Jun 21 '18 at 01:24

0 Answers0