i am learning the basics.......!

Thursday, February 01, 2007

Select certificate

This article is a good reference - How To Select Client Certificate in WinInet

HTTPSendRequest will fail with error code - ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (12044) if it needs a valid client certificate.

When the error comes: 1. Open the Microsoft certificate store - CertOpenSore
2. Find the certificate using - CertFindCertificateInStore() and get the CERT_CONTEXT
3. Use InternetSetOption with parameter - INTERNET_OPTION_CLIENT_CERT_CONTEXT. LPVOID). lpBuffer parameter should point to CERT_CONTEXT structure.

The KB article provided in the link was very much helpful to me.

No comments:

About Me

My photo
Predictably Unpredicatble, lazy, careless, sincere, honest, caring, Trouble maker, emotional, likeable