1

I am trying to use api to download data. My code is:

curl -u "accessID***:accessKey***" -X GET https://api.au.sumologic.com/api/v1/collectors?limit=2   (just follow the example from https://help.sumologic.com/APIs/Search-Job-API/About-the-Search-Job-API). But I have got the error:

Curl:(60) SSL certificate problem: unable to get local issuer 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. ...

Image:

enter image description here

I tried to read the info from https://curl.haxx.se/docs/sslcerts.html. But this is my first time to use api and curl. I really cannot understand how to fix this problem .

I run this code on a Windows server. I download the curl from https://curl.haxx.se/download.html. The version is

Windows 64 bit 7.61.1 binary the curl project.

halfer
  • 19,824
  • 17
  • 99
  • 186
Feng Chen
  • 2,139
  • 4
  • 33
  • 62

1 Answers1

1

Use http://curl.haxx.se/docs/sslcerts.html instead https://curl.haxx.se/docs/sslcerts.html you will avoid the SSL requirement.

Jonathan Gagne
  • 4,241
  • 5
  • 18
  • 30
  • Thanks a lot. But could you please explain how to "use" this webpage? Really do not know about this. – Feng Chen Oct 15 '18 at 05:51
  • First get your `accessId` and `accessKey`. Then once you got it, encode it in `base64` all together like this: `echo -n "your-accessId:your-accessKey" | base64`. It will give you something like `QWxhZGRpbjpPcGVuU2VzYW1`. Now you can authenticate like that `curl -H "Authorization: Basic " -X GET https://api.YOUR_DEPLOYMENT.sumologi...ectors?limit=2` – Jonathan Gagne Oct 15 '18 at 06:00
  • Thanks very much. Really help me a lot – Feng Chen Oct 15 '18 at 21:12
  • My pleasure anytime! – Jonathan Gagne Oct 15 '18 at 22:17