I am currently writing a utility application that will connect to this IP port and verify the information in the SSL certificate using HttpWebRequest. When I try to extract the certificate, I get an error. The exception, apparently, is that the SSL certificate help action seems to trigger another validation check.
Here is the code, and maybe someone can show me the best way to do this or if I missed something. I don't care if the SSL certificate has expired or does not match the URL. None of this is relevant to what I am doing.
When I assign a new variable to X509Certificate and look at the variable in the debugger, all properties show SSLCert.Issuer throws an exception like "System.Security.Cryptography.CyrptographicException"
When I try to access the SSLCert property, I get the following exception: m_safeCertContext is an invalid handle
I searched for this exception, but everything points to an invalid certificate, which may be true if the certificate has expired, and may be true for the IP and port combination to which I connect. But since I am connecting to IP using an IP address, rather than matching a common name, I expect this to be less since I still need the information.
Below is the code, I also added some comments for what does not work and what works.
omniplex
source share