一般证书上,对CRT和PEM证书没有特别做区分,故在nginx上部署了xxx.com_public.crt证书,发现curl 接口,出现如下错误:
curl 'https://xxx.com/api/campaign-names'
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.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.
需要加上 -k 才能正确访问;若直接使用pem证书,则无需加上 -k 参数;
另外,对于curl 请求带有"[]"括号时,会提示"bad range in URL position"字样,可以使用 "-g" 或 "--globoff" 参数来解决。