我正在尝试使用存储在NSS数据库中的证书进行cURL,但是在运行cURL命令时,它显示找不到证书。以下是my DB中的证书列表:
[root@localhost scripts]# certutil -L -d /nss
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
Test User u,u,u
Test Root CA ,,
Test SUBCA2 ,, 您可以看到"Test User“证书在那里。我还确认将SSL_DIR设置为DB目录:
[root@localhost scripts]# echo $SSL_DIR
/nss但是,当我运行cURL命令时:
[root@localhost etc]# curl -vk --cert "Test User" https://localhost:7446
* About to connect() to localhost port 7446 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 7446 (#0)
* Initializing NSS with certpath: sql:/nss
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* NSS: client certificate not found: Test User
* NSS error -5938
* Closing connection #0
curl: (35) NSS: client certificate not found: Test User找不到证书的原因是什么?
发布于 2015-11-19 04:14:41
我发现了问题所在。有几个问题。
在创建数据库时,我应该添加--flag password标志:
certutil -N -d /nss --empty-password此外,在添加证书时,我需要在NSS DB字段之前添加sql::
pk12util -i cert.p12 -d sql:/nsshttps://stackoverflow.com/questions/33784472
复制相似问题