windows - vbscript to download a file (bypassing invalid certificate errors) -


dim xhttp: set xhttp = createobject("microsoft.xmlhttp") dim bstrm: set bstrm = createobject("adodb.stream") xhttp.open "get", "https://www.website.com/apps/certmgr.exe", false xhttp.send  bstrm     .type = 1 '//binary     .open     .write xhttp.responsebody     .savetofile "c:\certmgr.exe", 2 '//overwrite end 

using above code i'm trying download file secure site install security certificate automatically, works fine http site, i'm needing bypass security errors. ideas?

you need switch msxml2.xmlhttp msxml2.serverxmlhttp , use setoption method value sxh_server_cert_ignore_all_server_errors. place call between open , send. here's example updated new code.

const sxh_server_cert_ignore_all_server_errors = 13056 dim xhttp: set xhttp = createobject("msxml2.serverxmlhttp") dim bstrm: set bstrm = createobject("adodb.stream") xhttp.open "get", "https://www.website.com/apps/certmgr.exe", false xhttp.setoption 2, sxh_server_cert_ignore_all_server_errors xhttp.send  bstrm     .type = 1 '//binary     .open     .write xhttp.responsebody     .savetofile "c:\certmgr.exe", 2 '//overwrite end 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -