如何在 Windows 7 的 CURL 中的证书存储中使用 .pfx

如何在 Windows 7 的 CURL 中的证书存储中使用 .pfx

我想使用 cURL 访问远程服务器,并且我需要使用私钥来识别自己,否则远程服务器会给出 401“未授权”。

我在 Windows 7 上(工作机器,不是我的选择),我的私钥安装在我的电脑上。我没有被允许直接访问它,但我相信它已正确安装在证书存储中。所以我想指定民众输入 cURL 命令,让操作系统计算出要使用哪个私钥。

我已经将公钥提供给远程服务器,他们已经接受并安装了它。

所以我这样做:

curl --verbose --cert "my-public-cert.pem" https://secure.server.com/path

...但是它不起作用,我收到了 58 错误:

*   Trying 12.34.56.78...
* Connected to secure.server.com (12.34.56.78) port 443 (#0)
* unable to use client certificate (no key found or wrong pass phrase?)
* Closing connection 0
curl: (58) unable to use client certificate (no key found or wrong pass phrase?)

我做错了什么,还是这根本不可能?如果我无法直接访问私钥但操作系统已安装私钥,是否有办法通过 SSL 发送 cURL 请求?

非常感谢,

布伦丹。

相关内容