In my desktop application i use HTTPS connection. Certificate is SELF-signed. How I can check self-signed certificate in c# programatically?
i make i a callback "ValidateRemoteCertificate":
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate)
By default, my "ValidateRemoteCertificate" method always return TRUE. But I think i need to check valid or invalid this certificate. How to check it? What i must to check in "ValidateRemoteCertificate"?
Since you already have implemented the callback you know the signature of the callback delegate
If I understand you correctly, the client does not have the certificate installed in his store, correct? Although I´d recommend getting your infrastructure in order and deploy a valid certificate, what you could do in your case, is to compare the hash/fingerprint for the certificate to values stored in your application to verify the validty of the certificate.