Discussion:
WinHttpQueryOption bug?
(too old to reply)
f***@yahoo.com
2007-11-07 07:57:50 UTC
Permalink
Hi,

I am having trouble with getting the server certificate
using WinHttp.

if (!WinHttpSendRequest(hReq, ...))
{
PCCERT_CONTEXT pCert;
DWORD size = sizeof(pCert);
WinHttpQueryOption(hReq, WINHTTP_OPTION_SERVER_CERT_CONTEXT,
(LPVOID)&pCert, &size);
}

WinHttpQueryOption() returns TRUE but pCert is 0.
And that seems to happen only if I configure my web server
to require client certificate (which means I have made a
WinHttpSetOption() to set the client cert before this).
Otherwise, it works ok.

This looks like a bug in WinHttp to me but I want to know
if anybody knows anything about this behavior?

Thanks
dk
2007-12-12 23:52:30 UTC
Permalink
Post by f***@yahoo.com
Hi,
I am having trouble with getting the server certificate
using WinHttp.
if (!WinHttpSendRequest(hReq, ...))
{
PCCERT_CONTEXT pCert;
DWORD size = sizeof(pCert);
WinHttpQueryOption(hReq, WINHTTP_OPTION_SERVER_CERT_CONTEXT,
(LPVOID)&pCert, &size);
}
WinHttpQueryOption() returns TRUE but pCert is 0.
And that seems to happen only if I configure my web server
to require client certificate (which means I have made a
WinHttpSetOption() to set the client cert before this).
Otherwise, it works ok.
This looks like a bug in WinHttp to me but I want to know
if anybody knows anything about this behavior?
Thanks
Which platform did you see this issue ? I tried something similar on
a vista x86 machine and did not see this issue.

Loading...