hash1baby
2005-04-18 07:02:15 UTC
Not making any progress solving our WININET problem, despite reading
other threads in this ng - any help appreciated.
We're using WININET to POST data to https on IIS. (Actually using
the gsoap_Wininet.cpp unit, which bridges gSOAP to WININET. The
source code is clear, purports to work with NTLM when
INTERNET_FLAG_KEEP_CONNECTION is set, and employs standard WININET
authentication patterns apparantly taken from MSDN sample code.)
We use ethereal to monitor traffic, and we're using the debug build
of wininet for logging.
The basic problem is that the HttpSendRequest fails with
GetLastError() = 12015, even though we use
INTERNET_FLAG_KEEP_CONNECTION in HttpOpenRequest.
Interaction as follows:
gSoap Wininet (tcp) Proxy
----- ------- -----
| | |
| InternetOpenA ----------> | |
| ("gSOAP", | |
| INTERNET_OPEN_TYPE_PRECONFIG, |
| NULL, NULL, 0) | |
|<-h1--------------------------+ |
| | |
| InternetSetStatusCallback-> |
| // (only for logging) | |
|<-----------------------------+ |
| | |
| InternetCrackUrl -------->| |
| (...) | |
|<-----------------------------+ |
| | |
| InternetConnect ---------->| |
| (hI, ...) | |
|<-hC--------------------------+ |
| | |
| HttpOpenRequestA --------->| |
| (hC, "POST", url, | |
| "HTTP/1.1", NULL, NULL, | |
| INTERNET_FLAG_SECURE | | |
| INTERNET_FLAG_KEEP_CONNECTION, |
| ...) | |
|<-hR--------------------------+ |
| | |
| HttpAddRequestHeadersA--> | |
| (hR,..) | |
|<-----------------------------+ |
| | |
|----HttpSendRequestA -------> | |
| (hR, NULL, 0, buffer, len) |
| | |
| | |
| | <-> { interaction to } <-> |
| | { download proxy.pac } |
| | |
| { open a CONNECT request } |
| | |
| HttpSendRequestA ------+ |
| | |-> |
| | CONNECT x.x.x.x:443 HTTP/1.0 |
| | User-Agent: gSOAP |
| | Host: x.x.x.x |
| | Content-Length: 0 |
| | Proxy-Connection: Keep-Alive |
| | Pragma: No-Cache |
| | | |
| | | |
| | |<- |
| | HTTP/1.1 407 Proxy |
| | Authentication Required ( The |
| | ISA Server requires |
| | authorization to fullfill the |
| | request. Access to the Web |
| | Proxy service is denied. ) |
| | Via: 1.1 machinename |
| | Proxy-Authenticate: NTLM |
| | ... |
| | Connection: Keep-Alive |
| | Proxy-Connection: Keep-Alive |
| | ... | |
| | | |
| |<---err = 12015-+ |
|<---err = 12015---------------+ |
The only notification I get on the StatusCallback is
INTERNET_STATUS_DETECTING_PROXY
I can see that internally WININET is failing to negotiation NTLM
through the proxy. I traced what happens when I use iexplore.exe
to GET the same resource, and saw exactly the same connect request
and 407 response status, except that WININET continued interaction
involved NTLM challenge-response before successfully connecting.
(Another maybe irrelavent difference was that WININET
created internal CONNECT request was opened using openned
INTERNET_FLAG_ASYNC. I don't know how to control that...)
btw, using WinXP (wininet.dll v6.0.2800.1400)
Any ideas appreciated.
Michael.
other threads in this ng - any help appreciated.
We're using WININET to POST data to https on IIS. (Actually using
the gsoap_Wininet.cpp unit, which bridges gSOAP to WININET. The
source code is clear, purports to work with NTLM when
INTERNET_FLAG_KEEP_CONNECTION is set, and employs standard WININET
authentication patterns apparantly taken from MSDN sample code.)
We use ethereal to monitor traffic, and we're using the debug build
of wininet for logging.
The basic problem is that the HttpSendRequest fails with
GetLastError() = 12015, even though we use
INTERNET_FLAG_KEEP_CONNECTION in HttpOpenRequest.
Interaction as follows:
gSoap Wininet (tcp) Proxy
----- ------- -----
| | |
| InternetOpenA ----------> | |
| ("gSOAP", | |
| INTERNET_OPEN_TYPE_PRECONFIG, |
| NULL, NULL, 0) | |
|<-h1--------------------------+ |
| | |
| InternetSetStatusCallback-> |
| // (only for logging) | |
|<-----------------------------+ |
| | |
| InternetCrackUrl -------->| |
| (...) | |
|<-----------------------------+ |
| | |
| InternetConnect ---------->| |
| (hI, ...) | |
|<-hC--------------------------+ |
| | |
| HttpOpenRequestA --------->| |
| (hC, "POST", url, | |
| "HTTP/1.1", NULL, NULL, | |
| INTERNET_FLAG_SECURE | | |
| INTERNET_FLAG_KEEP_CONNECTION, |
| ...) | |
|<-hR--------------------------+ |
| | |
| HttpAddRequestHeadersA--> | |
| (hR,..) | |
|<-----------------------------+ |
| | |
|----HttpSendRequestA -------> | |
| (hR, NULL, 0, buffer, len) |
| | |
| | |
| | <-> { interaction to } <-> |
| | { download proxy.pac } |
| | |
| { open a CONNECT request } |
| | |
| HttpSendRequestA ------+ |
| | |-> |
| | CONNECT x.x.x.x:443 HTTP/1.0 |
| | User-Agent: gSOAP |
| | Host: x.x.x.x |
| | Content-Length: 0 |
| | Proxy-Connection: Keep-Alive |
| | Pragma: No-Cache |
| | | |
| | | |
| | |<- |
| | HTTP/1.1 407 Proxy |
| | Authentication Required ( The |
| | ISA Server requires |
| | authorization to fullfill the |
| | request. Access to the Web |
| | Proxy service is denied. ) |
| | Via: 1.1 machinename |
| | Proxy-Authenticate: NTLM |
| | ... |
| | Connection: Keep-Alive |
| | Proxy-Connection: Keep-Alive |
| | ... | |
| | | |
| |<---err = 12015-+ |
|<---err = 12015---------------+ |
The only notification I get on the StatusCallback is
INTERNET_STATUS_DETECTING_PROXY
I can see that internally WININET is failing to negotiation NTLM
through the proxy. I traced what happens when I use iexplore.exe
to GET the same resource, and saw exactly the same connect request
and 407 response status, except that WININET continued interaction
involved NTLM challenge-response before successfully connecting.
(Another maybe irrelavent difference was that WININET
created internal CONNECT request was opened using openned
INTERNET_FLAG_ASYNC. I don't know how to control that...)
btw, using WinXP (wininet.dll v6.0.2800.1400)
Any ideas appreciated.
Michael.