Skip to content

Commit

Permalink
Added '-ignoreCertError' command line argument to winhttpjs.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
Stybi authored and Michal Stybnar committed Jun 15, 2021
1 parent 36ff0d6 commit d194d42
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hybrids/jscript/winhttpjs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var proxy_pass = 0;
var certificate = 0;

var force = true;
var ignoreCertError = false;

var body = "";

Expand Down Expand Up @@ -120,8 +121,10 @@ function printHelp() {

WScript.Echo(" [-body body-string]");
WScript.Echo(" [-body-file body-file]");
WScript.Echo(" [-ignoreCertError yes|no]");

WScript.Echo("-force - decide to not or to overwrite if the local files exists");
WScript.Echo("-ignoreCertError - ignore certificate error");

WScript.Echo("proxyserver:port - the proxy server");
WScript.Echo("bypass- bypass list");
Expand Down Expand Up @@ -170,6 +173,11 @@ function parseArgs() {
force = false;
}
break;
case "-ignorecerterror":
if (next == "yes") {
ignoreCertError = true;
}
break;
case "-escape":
if (next == "yes") {
escape = true;
Expand Down Expand Up @@ -355,6 +363,12 @@ function request(url) {
WinHTTPObj.SetClientCertificate(certificate);
}

if (ignoreCertError) {
// https://stackoverflow.com/questions/20261520/microsoft-jscript-bypassing-certificate-error
WScript.Echo("ignore cert error...");
WinHTTPObj.Option(4) = 0x3300; // SslErrorIgnoreFlags = IgnoreAll;
}

//set autologin policy
WinHTTPObj.SetAutoLogonPolicy(autologon_policy);
//set timeouts
Expand Down

0 comments on commit d194d42

Please sign in to comment.