小编Cra*_*ote的帖子

找不到 CURL NSS 客户端证书 myCert

我正在尝试使用curl 访问https 地址,将我的证书传递给它并使用我自己的信任库(我们有自己的CA)验证服务器的证书。我现在以 root 身份运行。

curl -v --cert /home/cdfoote/myCertificate.pem:mypassword --cacert /home/cdfoote/truststore.pem https://host.com:8444
Run Code Online (Sandbox Code Playgroud)

这给了我错误:

Unable to load client cert -8018
NSS error -8018
Run Code Online (Sandbox Code Playgroud)

谷歌搜索并确定我的curl是用nss编译的,我已将我的证书转换为.pfx(我从.jks开始)并通过以下方式将其导入到nss数据库中:

pk12util -i /home/cdfoote/myCertificate.pfx -d /etc/pki/nssdb
Run Code Online (Sandbox Code Playgroud)

当我列出数据库中的所有证书时,我看到它:

certutil -L -d /etc/pki/nssdb
Run Code Online (Sandbox Code Playgroud)

当我按昵称列出它时,我会看到它的详细信息:

certutil -L -d /etc/pki/nssdb -n myCert
Run Code Online (Sandbox Code Playgroud)

我已经通过以下方式使数据库可用:

export SSL_DIR=/etc/pki/nssdb
Run Code Online (Sandbox Code Playgroud)

现在,我正在运行的curl命令是:

curl -v --cert myCert --cacert /home/cdfoote/truststore.pem https://host.com:8444
Run Code Online (Sandbox Code Playgroud)

响应是:

About to connect to https//host.com port 8444 (#0)
Trying ipaddress
Connected to host.com (ipaddress) port 8444(#0)
Initializing NSS with certpath: sql:/etc/pki/nssdb
CAfile: /home/cdfoote/truststore.pem
CApath: none
NSS: client certificate …
Run Code Online (Sandbox Code Playgroud)

curl

5
推荐指数
0
解决办法
2万
查看次数

标签 统计

curl ×1