In my application I have situations in which I need to make a requests to servers that have self-signed certificates. I would like to be able to disable certificate validation only for that particular request.
I know I can disable certificate validate by setting ServicePointManager.ServerCertificateValidationCallback to point to a callback method and simply return true. However this then disables certificate validation for the entire application which I could simply do by setting in app.config.
However I do not want to disable for the entire application but rather disable for an individual request. Is that possible?
The class I am working with is SmtpClient