Shell curl 命令报错:(60) SSL certificate problem: self signed certificate

  • curl 命令向服务器发送 https 请求
root@53c79d8a7095:~# curl --header "PRIVATE-TOKEN: Nf1kK4MeF4fPMo7d4jY2" https://172.16.0.168/api/v4/projects?search=xxxx
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
  • 然后搜了一下,一开始以为是daijiguo的blog说的,需要设置参数,但实际上那应该是 PHP 相关的设置。
  • 然后继续 Google,找到了bytxlcurl需要加上-kwget需要加上--no-check-certificate
curl --header "PRIVATE-TOKEN: Nf1kK4MeF4fPMo7d4jY2" https://172.16.0.168/api/v4/projects?search=xxxx -k

wget 'https://172.16.0.168/api/v4/projects?search=xxxx -k' --no-check-certificate

结束语

  • 好记性不如烂键盘!希望可以加快大家解决问题的速度!

猜你喜欢

转载自blog.csdn.net/Koprvhdix/article/details/81241218
今日推荐