You should not write methods to validate certificates. Those methods are often used to bypass validation altogether, which is bad for security.
System.Net.ServicePointManager.ServerCertificateValidationCallback = ... // non compliant
var handler = new System.Net.Http.HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = ... // non compliant