Resolving an Error When a Program Uses the Microsoft.XMLHTTP Object to Request https

Published: 2020-03-06

When using the Microsoft.XMLHTTP component in the program to request https, the following error occurs:

image.png

Example of the program code causing the error:

strUrl = "https://www.xxx.com/xxx.asp?id=11"
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP") 
objXmlHttp.open "GET",strUrl,False        
objXmlHttp.send()

Solution: Replace Microsoft.XMLHTTP with "WinHttp.WinHttpRequest.5.1", that is, modify the corresponding program file code:

Change

set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")

to:

Set objXmlHttp= Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objXmlHttp.option(9) = 2720
After saving, it will take effect.