tags:

views:

145

answers:

1

I am trying in code to access a URL running on IIS (6 or 7) and in it find out what is the SSL certificate and specifically who the certificate was issued to. Usually this is the url of the site if the certificate is valid. However, in my case I want to get the information from an internal IP that is behind the loadbalancer so I cannot count on this. Does anybody know how this can be achieved? Preferably using C#, but I am open to anyother development language

+2  A: 

I have managed to find a way to do that. If you install OpenSSL : http://www.openssl.org (and a windows version here: http://www.slproweb.com/products/Win32OpenSSL.html) you can use its command line interface to query a certificate like this: openssl s_client -connect IP:443 Then you just need to check the response for the site the certificate was issued to.

thunderc