【问题标题】:HTTP request inside Azure CLI GitHub action fails with SSL expired errorAzure CLI GitHub 操作中的 HTTP 请求失败并出现 SSL 过期错误
【发布时间】:2021-10-01 21:58:31
【问题描述】:

我们正在使用 AZ CLI GitHub Action azure/CLI (https://github.com/marketplace/actions/azure-cli-action)

此工作流调用的脚本向外部 API 发出 HTTP 请求。此 cURL 调用失败并显示以下内容:

curl: (60) SSL certificate problem: certificate has expired
More details here: 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.

但是我可以确认相同的请求在本地有效。

问题工作流程步骤如下所示:

- name: Run script
  uses: azure/CLI@1.0.4
  with:
    azcliversion: 2.0.72
    inlineScript: |
      $GITHUB_WORKSPACE/github/scripts/script.sh

当我可以在我自己的机器上成功地对同一个 API 域进行相同的调用时,为什么 cURL 认为外部 API 域的 SSL 证书已过期?

【问题讨论】:

    标签: github-actions azure-cli


    【解决方案1】:

    问题似乎在于azcliversion 指向的 AZ CLI 版本具有过时的证书。

    问题已通过完全删除 azcliversion 字段得到解决,因为默认版本是 最新,如操作文档中指定的那样:

    azcliversion可选示例:2.0.72,默认:最新

    所以这一步现在看起来像这样:

    - name: Run script
      uses: azure/CLI@1.0.4
      with:
        inlineScript: |
          $GITHUB_WORKSPACE/github/scripts/script.sh
    

    可能与此有关:https://twitter.com/letsencrypt/status/1443621997288767491

    我们的交叉签名 DST 根 CA X3 今天过期了。如果您遇到错误,请查看我们社区论坛中的修复程序。我们发现续订量高于正常水平,因此您获得证书的速度可能会有所放缓。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-12
      • 2014-08-14
      • 2016-05-12
      • 2020-12-28
      相关资源
      最近更新 更多