Reputation: 31
URL = "https://github.com/index.html"
Set xHttp = CreateObject("MSXML2.ServerXMLHTTP")
xHttp.Open "GET", URL, False
xHttp.setOption 2, 13056
xHttp.Send()
can anybody tell, why this code works on windows7, and does not work on windows XP
error
msxml3.dll error '80090326' `
The message received was unexpected or badly formatted.`
on xHttp.Send
Upvotes: 3
Views: 6731
Reputation: 71
We had to install the following KB in a Windows 2003 server:
https://support.microsoft.com/en-us/kb/948963
After this, another error:
msxml3.dll error '80072f7d'
An error occurred in the secure channel support
Thanks to this post (server giving msxml3.dll error '80072f7d' when trying to access secure url) installed the http://support.microsoft.com/kb/938397 and worked.
When aplying to production, only the first KB solved the problem.
Upvotes: 1
Reputation: 31
I recently encountered a similar problem trying to retrieve a file via https onto a Windows 2003 server. Turned out the problem was that the set of SSL/TLS ciphers supported on the client-side was so old that none of them was supported on the server.
In my case, the server was behind an AWS ELB, which was doing the https negotiation. I was able to reconfigure the ELB to use an older cipher set (In the 'Listeners' tab, change the cipher config to use ELBSecurityPolicy-2015-05), and the client-side script magically started to work.
Upvotes: 2
Reputation: 18827
If you change the MSXML2.ServerXMLHTTP to MSXML2.XMLHTTP or Microsoft.XMLHTTP it works or not for you ?
Try with this code and tell us if you get the same errors or not (tested only on windows 7)
On Error Resume Next
Set File = WScript.CreateObject("MSXML2.XMLHTTP")
File.Open "GET", "https://github.com/index.html", False
'This is IE 8 headers
File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)"
File.Send
If err.number <> 0 then
line =""
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "Error getting file"
Line = Line & vbcrlf & "=================="
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description
Line = Line & vbcrlf & "Source " & err.source
Line = Line & vbcrlf & ""
Line = Line & vbcrlf & "HTTP Error " & File.Status & " " & File.StatusText
Line = Line & vbcrlf & File.getAllResponseHeaders
wscript.echo Line
Err.clear
wscript.quit
End If
On Error Goto 0
Set BS = CreateObject("ADODB.Stream")
Set ws = CreateObject("wscript.Shell")
BS.type = 1
BS.open
BS.Write File.ResponseBody
BS.SaveToFile "Location.html", 2
ws.run "Location.html"
Upvotes: 0