[英]HTTP request inside Azure CLI GitHub action fails with SSL expired error
我們正在使用 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
為什么 cURL 認為外部 API 域的 SSL 證書已過期,而我可以在我自己的機器上成功地對同一個 API 域進行相同的調用?
問題似乎是azcliversion
指向一個具有過時證書的 AZ CLI 版本。
通過完全刪除azcliversion
字段解決了該問題,因為默認版本是latest ,如操作文檔中所指定:
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 Root CA X3 今天過期了。 如果您遇到錯誤,請查看我們社區論壇中的修復程序。 我們發現續訂次數高於正常情況,因此您獲得證書的速度可能會變慢。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.