CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized

证书错误

当请求某个网址的时候出现如下所示的证书错误

[root@clink-z1-monitor1 ~]# curl -H "Authorization: Bearer TOKEN值" https://IP地址:端口/api/dashboards/home

 

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.

解决办法:

1、下载网址所对应的2级证书(倒数第二级

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第1张图片

 

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第2张图片

 

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第3张图片

 

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第4张图片

 

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第5张图片

用记事本打开文件

CURL请求证书错误:curl: (60) Peer's Certificate issuer is not recognized_第6张图片

复制其中的内容

将所复制的内容追加到

/etc/pki/tls/certs/ca-bundle.crt文件之中

 

你可能感兴趣的:(运维,Liunx)