In my application, I have situations where I need to make requests to servers with self-signed certificates. I would like to be able to disable certificate verification only for this particular request.
I know that I can turn off certificate verification by setting ServicePointManager.ServerCertificateValidationCallback to specify a callback method and just return true. However, this disables certificate verification for the entire application, which I could just do by installing in app.config.
However, I do not want to disable for the entire application, but rather disconnect a separate request. Is it possible?
The class I'm working with is SmtpClient
source
share