【发布时间】:2014-01-24 23:52:17
【问题描述】:
我遇到了curlcommand 的 SSL 问题。我想使用我的 SSL 客户端证书和私钥访问 URL。
这是我的命令:
$ curl -k -v "https://myurl.com/" --cert ./certificate.pem --key ./private.key
* About to connect() to xx.xx.xx.xx port 23444 (#0)
* Trying xx.xx.xx.xx... connected
* Connected to xx.xx.xx.xx (xx.xx.xx.xx) port 23444 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* Unable to load client key -8178.
* NSS error -8178
* Closing connection #0
curl: (58) Unable to load client key -8178.
密钥是受密码保护的,curl 并没有要求我输入密码,这很奇怪。即使我使用--pass 传递密码,我仍然会收到同样的错误。
似乎没有考虑参数--key,因为如果我用我的文件系统上不存在的foo.key 替换,我仍然会得到同样的错误。
但是,如果使用:
$ wget --certificate=./certificate.pem --private-key=private.key "https://myurl.com/" --no-check-certificate
我可以访问我的网址。
你有什么想法吗?
【问题讨论】:
-
关于什么的权限问题?
-
一种解决方法是将您的证书导入 NSS 数据库,如下所示:stackoverflow.com/questions/15773806/… 我在您之前搜索了另一个解决方案,但没有找到。如果你这样做,请发布它
标签: curl ssl client-server