Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssl 找不到客户端证书_Ssl_Curl_Certificate_Nss - Fatal编程技术网

Ssl 找不到客户端证书

Ssl 找不到客户端证书,ssl,curl,certificate,nss,Ssl,Curl,Certificate,Nss,我可以做些什么来排除/修复我的curl命令在通过昵称引用证书时找不到证书的原因 我试图获得一个安全的连接到银行服务器,这是处理我们的在线支付,使用curl。服务器正在使用NSS协议。我使用以下方法将银行的证书安装到nssdb中,昵称为“foo”: 列出证书以检查它是否已创建,我使用 certutil -L -d sql:/etc/pki/nssdb/ 输出确认证书的昵称为“foo”: Certificate Nickname Trust Attributes SSL,S/MIME,JAR

我可以做些什么来排除/修复我的curl命令在通过昵称引用证书时找不到证书的原因

我试图获得一个安全的连接到银行服务器,这是处理我们的在线支付,使用curl。服务器正在使用NSS协议。我使用以下方法将银行的证书安装到nssdb中,昵称为“foo”:

列出证书以检查它是否已创建,我使用

certutil -L -d sql:/etc/pki/nssdb/
输出确认证书的昵称为“foo”:

Certificate Nickname  Trust Attributes
  SSL,S/MIME,JAR/XPI
foo  P,P,P
当我尝试使用curl引用连接到证书的昵称foo时,如下所示:

curl -k -v --cert "foo" https://ccapi.client.qvalent.com/payway/ccapi
这是输出的一部分:

Connected to proxy.ourdomain.com.au (172.21.0.58) port 3128 (#0)
Establish HTTP proxy tunnel to ccapi.client.qvalent.com:443
CONNECT ccapi.client.qvalent.com:443 HTTP/1.1
Host: ccapi.client.qvalent.com:443
User-Agent: curl/7.37.0
Proxy-Connection: Keep-Alive

HTTP/1.1 200 Connection established

Proxy replied OK to CONNECT request
Initializing NSS with certpath: sql:/etc/pki/nssdb
skipping SSL peer certificate verification
NSS: client certificate not found: foo
最后一行:找不到证书:foo,这是我的问题。在nssdb中使用昵称创建证书时,我似乎做得很好,但在使用curl命令连接时,它找不到证书。如果我像这样链接到实际证书,而不是昵称:

curl -k -v --cert "./ccapi.pem" https://ccapi.client.qvalent.com/payway/ccapi
然后证书被识别,但我无法连接到银行服务器。这可能是因为我需要使用NSS,但这与我试图得到的答案无关。我在stackoverflow上发现了类似的问题,例如,但它们没有回答这个问题。我没有/使用PKCS#12证书。 如何排除/修复curl命令在通过昵称引用证书时找不到证书的原因

谢谢你的帮助

-M

curl -k -v --cert "./ccapi.pem" https://ccapi.client.qvalent.com/payway/ccapi