Shell curl command reported an error: (60) SSL certificate problem: self signed certificate

The curl command sends HTTPS requests to the server

[email protected]:~# 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.

And then I did a search, and at first I thought it was the Daijiguo blog that said you need to set the parameters, but in fact that should be PHP related Settings. Then continue to Google, find bytxl, curl need to add -k, wget need to add --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

conclusion
A bad keyboard is worse than a good memory! Hope to speed up the speed of solving the problem!

Read More: