【问题标题】:curl failed when downloading data from sumo logic从相扑逻辑下载数据时 curl 失败
【发布时间】:2019-03-19 12:09:06
【问题描述】:

我正在尝试使用 api 下载数据。我的代码是:

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 证书问题:无法获取本地颁发者证书更多详情:https://curl.haxx.se/docs/sslcerts.html

curl 未能验证服务器的合法性,因此无法与它建立安全连接。 ...

图片:

我试图从https://curl.haxx.se/docs/sslcerts.html 读取信息。但这是我第一次使用 api 和 curl。我真的不明白如何解决这个问题。

我在 Windows 服务器上运行此代码。我从https://curl.haxx.se/download.html 下载 curl。版本是

Windows 64 位 7.61.1 二进制 curl 项目。

【问题讨论】:

    标签: api ssl curl download sumologic


    【解决方案1】:

    使用http://curl.haxx.se/docs/sslcerts.html 代替https://curl.haxx.se/docs/sslcerts.html 您将避免SSL 要求。

    【讨论】:

    • 非常感谢。但是你能解释一下如何“使用”这个网页吗?真的不知道这个。
    • 首先获取您的accessIdaccessKey。然后,一旦你得到它,将它编码为base64,如下所示:echo -n "your-accessId:your-accessKey" | base64。它会给你类似QWxhZGRpbjpPcGVuU2VzYW1的东西。现在你可以像curl -H "Authorization: Basic <encoded string like QWxhZGRpbjpPcGVuU2VzYW1>" -X GET https://api.YOUR_DEPLOYMENT.sumologi...ectors?limit=2 那样进行身份验证
    • 非常感谢。真的帮了我很多
    • 我的快乐随时!
    猜你喜欢
    • 1970-01-01
    • 2018-02-26
    • 1970-01-01
    • 1970-01-01
    • 2018-11-08
    • 2017-04-20
    • 2015-03-29
    • 2014-06-20
    • 1970-01-01
    相关资源
    最近更新 更多