I am trying to debug an issue, but could use some pointers from others suffering similar fate. The issue seems to be with Windows XP SP3 and use of the WinHttp library with certificates installed. Under these conditions, WinHttp throws a WindowsError (ERROR_WINHTTP_INVALID_SERVER_RESPONSE), even though Wireshark shows it received the 200/OK response along with the XML data that was expected. The WinHttp library is obviously doing some additional error checking that is causing it to think something is not right with the response. Running the same code on a Windows 7 machine, produces exactly the same request and responses in Wireshark, except that WinHttp doesn't invalidate the response with the ERROR_WINHTTP_INVALID_SERVER_RESPONSE error; it seems to think everything is okay.
I have done some Googling and spent more time than I would like changing options. My next port of call is to setup an SSH tunnel running netcat, so that I can identify if any of the headers are causing the problem. Process of elimination.
Unless of course, somebody already knows the answer?
Versions
Python 2.7.3 WinHttp 5.1 (the usual one you get with Windows XP Sp3 IE 8) Windows XP Professional SP3 (Automatic updates seem up-to-date)
Note
This also happens on Windows Server 2003
Update
I can reproduce this issue using a simple script to fake a connection request to the server.
Script
(function() {
var soapXmlReq =
'<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="urn:vim25"><ns1:RetrieveServiceContent><ns1:_this type="ServiceInstance">ServiceInstance</ns1:_this></ns1:RetrieveServiceContent></SOAP-ENV:Body></SOAP-ENV:Envelope>',
soapXmlReqHeaders = {
'Content-Type': 'text/xml; charset="utf-8"',
'SOAPAction': 'urn:vim25/5.1',
'User-Agent': 'VMware VI Client/5.0.0',
'Content-Length': soapXmlReq.length,
'Accept': '*/*',
'Host': 'vcenter',
'Connection': 'Keep-Alive'
};
function fakeLogin() {
WScript.StdOut.WriteLine("ActiveXObject('WinHttp.WinHttpRequest.5.1')");
var req = WScript.CreateObject("WinHttp.WinHttpRequest.5.1"),
result, header;
WScript.StdOut.WriteLine("Open('POST', 'https://vcenter/sdk', false)");
req.Open("POST", "https://vcenter/sdk", false);
for (header in soapXmlReqHeaders) {
WScript.StdOut.WriteLine("SetRequestHeader('" + header + ": " + soapXmlReqHeaders[header] + "')");
req.SetRequestHeader(header, soapXmlReqHeaders[header]);
}
//WScript.StdOut.WriteLine("Send('" + soapXmlReq + "')");
WScript.StdOut.WriteLine("Send()");
req.Send(soapXmlReq);
WScript.StdOut.WriteLine("ResponseText = " + req.ResponseText);
}
fakeLogin();
})();
Just run the script using CScript.exe and the output comes out on stdout.
I have noticed that the response packets are larger than the MTU, so they get fragmented. Would this have anything to do with it?