【问题标题】:curl (58) unable to load client cert -8912curl (58) 无法加载客户端证书 -8912
【发布时间】:2014-05-16 22:37:50
【问题描述】:

我在使用来自 linux 的 curl 与 Azure 通信时遇到问题。当我发送以下命令时:

curl -E "/home/rainey/azure-cert.cer" -H "x-ms-version: 2014-05-09" "https://management.core.windows.net/[subscription id]/services/hostedservices"

  • 我收到以下错误: curl (58) 无法加载客户端证书 -8912

我错过了什么?

【问题讨论】:

  • 两件事:1. 您是否通过门户或 PowerShell 将证书上传到订阅中的管理证书存储? 2. 详细说明您是如何创建证书的。
  • 嗨 sebastus,我使用 azure 门户上传了证书。它的创建方式如下: openssl x509 -outform der -in azure-cert.pem azure-cert.cer
  • pem 文件是使用以下命令创建的:openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout azure-cert.pem -out azure-cert.pem

标签: linux azure curl


【解决方案1】:

您需要在 cURL 命令行中使用 .pem 文件。 .cer 用于上传到 Azure 门户中的管理证书存储。

这里有几篇博客文章,其中包含许多工作示例:

http://blogs.msdn.com/b/tconte/archive/2012/11/29/how-to-use-the-windows-azure-service-management-api-from-curl-to-create-virtual-machines.aspx

http://blog.toddysm.com/2012/01/accessing-windows-azure-rest-apis-with-curl.html

【讨论】:

    猜你喜欢
    • 2014-01-24
    • 2013-10-16
    • 1970-01-01
    • 2017-02-03
    • 2015-06-30
    • 1970-01-01
    • 2018-11-24
    • 2023-02-03
    相关资源
    最近更新 更多