[CMD]http/https測試連線curl

  • 785
  • 0

使用curl來進行驗證連線

// location
[root@apServer ~]$ curl -L https://111.222.33.444 
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate

// location、insecure
[root@apServer ~]$ curl -k -L https://111.222.33.444 
<meta http-equiv="Refresh" content="0;URL='https://test.com.tw/main.html'" />[root@apServer ~]$ ^C

// error
[root@apServer ~]$ curl -k -L https://999.999.99.999 
curl: (6) Could not resolve host: 999.999.99.999; Unknown error


###> curl -L <URL>
<URL>:連線網址,含http(s)://
如果是https,且對方為ip或非使用公共憑證,請在測試語法內加上 -k
-L, --location      Follow redirects
-k, --insecure      Allow insecure server connections when using SSL