Discussion:
WinHttpSetCredentials: Problem with Empty Password
(too old to reply)
D3D
2010-06-25 04:52:44 UTC
Permalink
Hi All,

Our Http client interacts with server which uses Digest
Authentication. We have used standard sample code available for
WinHttp at msdn "http://msdn.microsoft.com/en-us/library/aa383144%28VS.
85%29.aspx"

This is main method to set credentials,
bResults = WinHttpSetCredentials( hRequest,
WINHTTP_AUTH_TARGET_PROXY,
dwProxyAuthScheme,
pGetRequest->szProxyUsername,
pGetRequest->szProxyPassword,
NULL );

Method works fine when we specify user name and password but we have
problems with Empty Password. With empty or blank or NULL password,
WinHttpSetCredentials method succeeds but does not generate Server
Request with Digest. The method defination on MSDN does say this
"pwszPassword [in] Pointer to a string that contains a valid password.
The password can be blank"

Not sure what is the problem here. Any inputs will be of great help.

Thanks
eXception
2010-07-26 09:47:24 UTC
Permalink
Does it make sense to use digest authentication without a password?

I mean, the username is still sent unencrypted even in digest
authentication. And the password is md5 hashed - what's the md5 hash
of an empty string?

See example headers in wikipedia:
http://en.wikipedia.org/wiki/Digest_access_authentication

Loading...