If you send an HTTPS request to the server using WinHttp, you can retrieve
the server's certificate by querying the WINHTTP_OPTION_SERVER_CERT_CONTEXT
option. This will provide a pointer to a CERT_CONTEXT structure that
describes the server's certificate.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/option_flags.asp
There is also a WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT option that
provides some details about the certificate.
Hope that helps.
Regards,
- Stephen