2017-05-30 25 views
1

嗨我想在我的服務器上發起https請求。我如何包含https以獲取響應?我要重新啓動服務器,如果我得到一個HTTPS代碼的結果是不是200。這裏是我的源代碼如何在https上包含https重啓服務ping結果

@set @x=0 /* 
:: ChkHTTP.cmd 
@echo off 
setlocal 
set "URL=https://localhost:8080/ping.xhtml" 
cscript /nologo /e:jscript "%~f0" %URL% | find "200" > nul 
echo going to check error 
if %ErrorLevel% EQU 0 (
echo Web server ok 
) else (
echo Weber server not ok 
echo kill task and then restart service 
) 
JScript */ 
var x=new ActiveXObject("Msxml2.ServerXMLHTTP.6.0"); 
x.setOption(2,13056); 
x.open("GET",WSH.Arguments(0));x.send(); 
while (x.ReadyState!=4) {WSH.Sleep(15000)}; 
WSH.Echo(x.status); 

它會等待15秒才能運行。但它的運行永遠如果它的https?

我想忽略由於它運行在HTTPS的SSL事實錯誤

回答

1

它不會有可能忽略SSL錯誤。替代運行在http服務器上的例子:http://localhost