httphttpsvbscriptmsxml6

MSXML6.dll Access Denied redirecting HTTP to HTTPS


I am using MSXML6 in a vbscript-like code to download data over HTTP. But the server now requires connections to upgrade to HTTPS. This is causing the xmlhttp object to fail with the error "msxml6.dll: Access is denied."

Set http = CreateObject("msxml2.xmlhttp.6.0")
http.open "Get", URL, False 'false is for 'async'
http.send

Using a sniffing tool, the operation stops after receiving the redirection-to-https response, and the error is generated without further details.

Requesting http://host/doc.php (plain http), the returned headers look something like this:

HTTP/1.1 301 Moved Permanently
Date: Fri, 19 Jul 2019 23:59:30 GMT
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
Location: https://host/doc.php
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare

However, if the requested URL is already https, the operation resumes normally without any complaint.

Is there anything I can do on the server side to convince xmlhttp to upgrade the connection to https peacefully?

Updating the code in the client application is out of the question as it is a legacy application with so many users out there using it, without an update mechanism.

Asking the users to update the URL adding an "s" after http is workable but too much hassle, as reaching them to tell them is also not easy at all.

Edit:

The conclusion is in this comment. The summary is that this is a client-side protection feature and it cannot be overridden from the server side.


Solution

  • The problem as mentioned in Xmlhttp request is raising an Access Denied error is you need to use the Server version of XMLHTTP that isn't restricted to accessing sites trusted by IE and restricted by the IE security policies. This is because XMLHTTP is designed for client-side whereas ServerXMLHTTP is specifically designed for server-side usage.