1. 程式人生 > 其它 >curl命令詳解

curl命令詳解

curl請求https需要新增引數-k

請求檢視響應頭資訊可以用-I

[machangwei@localhost ~]$ curl -I https://es.b2b.10086.cn/
curl: (60) Peer's Certificate issuer is not recognized.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
[machangwei@localhost ~]$ curl -I -k https://es.b2b.10086.cn/


HTTP/1.1 200 OK
Date: Sat, 20 Nov 2021 01:53:50 GMT
Server: Apache
Last-Modified: Mon, 11 Jun 2007 18:53:14 GMT
ETag: "2d-432a5e4a73a80"
Accept-Ranges: bytes
Content-Type: text/html
Content-Length: 45
Connection: Keep-alive
Via: 1.1 ID-0002262061156206 uproxy-17