1. 程式人生 > >Shell curl 命令報錯:(60) SSL certificate problem: self signed certificate

Shell curl 命令報錯:(60) SSL certificate problem: self signed certificate

  • curl 命令向伺服器傳送 https 請求
[email protected]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

結束語

  • 好記性不如爛鍵盤!希望可以加快大家解決問題的速度!