how can I resolve "the CRLfile:none" the error when I do curl command?

5.1k views Asked by At
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 2118b878-46a8-3b9d-a911-8ac18a0b13cf' 'https://172.17.0.1:8243/V1.0.2/stock/getParam?age=123'

curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

After I design an API on API MANAGER PLATFORM, I do the curl command and there is the above logs. How to resolve the cert?

2

There are 2 answers

0
ti7 On

You're probably having trouble with a self-signed certificate.

Get the certificate and use the argument --cacert <certfile> to authenticate with it.

To test your function and if you are absolutely certain that the certificate is OK, try -k to accept the invalid certificate. However, you must never, ever do this in production and/or if you are unsure that it is the certificate that you intended as it takes away the value of using SSL.

7
Jenananthan On

you can use "-k" option[1] in curl command to have insecure ssl connection.If you want to verify the server cert then you need to point the trust cert bundle to curl using optin "--cacert" [1]

curl -k -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 2118b878-46a8-3b9d-a911-8ac18a0b13cf' 'https://172.17.0.1:8243/V1.0.2/stock/getParam?age=123'

[1] https://curl.haxx.se/docs/manpage.html