I am trying to write a Win32 app that would connect and fetch
information from a Web site. I wanted to be able to do that from a
Windows 95 workstation, authenticated on a NT domain. I access
the Web through a MS proxy server, configured to demand NTLM
authentication. I use the following sequence :
InternetOpen (using INTERNET_OPEN_TYPE_PRECONFIG)
InternetConnect
HttpOpenRequest
HttpSendRequest
InternetReadFile
HttpEndRequest
It works fine in a non proxied environement, but, when I try to use it
through the proxy, from a NT-domain autenticated account,I keep having
the following message :
407 Proxy Authentication Required
You must authenticate with a proxy server before this request can be
serviced. Please log on to your proxy server, and then try again.
while I have absolutely no problem with IE.
Does anybody has an idea ? I have already tried to repeat the
HttpSendRequest/InternetReadFile part, to swallow the first answer from
the proxy.
Sent via Deja.com http://www.deja.com/
Before you buy.
I too got a similar error but had a workaround by passing the proxy userid
and password
check out
http://msdn.microsoft.com/workshop/networking/wininet/overview/authenticatio
n.asp
for a solution to this.
I have a follow up question.
Does INTERNET_OPEN_TYPE_PRECONFIG retrieve proxy userid and password
automatically.
I guess it does not since i got a 407 error. Does IE store that in the
registry . If so where.
My requirement is:
if the user already logs on to the website and provides authentication
userid/password.,
can i use that information stored somewhere in the registry to reconnect to
the Internet using wininet.
(basically i dont want another dialog to come up asking for user to enter
the userid/password again)
Thanks
Vittal
<Thierry...@yahoo.com> wrote in message
news:7v59ae$o8d$1...@nnrp1.deja.com...
-- Thanks, Jeff
jbra...@iname.com
Ok folks, the magic answer is to add the INTERNET_FLAG_KEEP_CONNECTION
flag in the HttpOpenRequest call. for example :
hHandleOpenRequest = HttpOpenRequest( hHandleConnect , NULL ,
pszObject, NULL , NULL, NULL,
INTERNET_FLAG_KEEP_CONNECTION ,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ulContext );
And that's all. WININET will automagically handle the connection with a
NTLM authentication at the proxy. I found that by sniffing a legit IE
HTTP session in a proxied environnement. So it means that once the user
is authenticated on the domain, any app can open a HTTP (or FTP)
connection without user intervention.
How did u sniff the ie HTTP session?
I've installed the debug wininet.dll (File Version: 5.00.2919.3800) from the
Oct 99 MSDN Platform SDK.
But it crashes IE 5.0 (File Version 5.00.2014.200).
tia,
Kalpna