我正在尝试通过 Centos 6 系统上的 PHP curl 访问第三方服务,该系统附带针对 NSS 而不是 OpenSSL 编译的 curl 和 libcurl。
这给我带来了问题,每次我尝试访问该服务时,我都会收到此错误 NSS: client certificate not found (nickname not specified)
。
我的理解是我需要在 NSS 数据库中安装证书。
我正在寻找有关如何执行此操作的分步说明(请记住,我需要它来处理从 Nginx 服务器调用的 PHP curl 函数)
谢谢
最佳答案
尝试在证书文件名前加上“./”前缀,或使用完整路径。来自 curl 联机帮助页:
If curl is built against the NSS SSL library then this option [--cert] can tell curl the nickname of the certificate to use within the NSS database defined by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the NSS PEM PKCS#11 module (lib- nsspem.so) is available then PEM files may be loaded. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname.
(强调我的)
或者,这里有一些导入 NSS 证书数据库的说明,虽然我没有用过: http://rcritten.fedorapeople.org/nss_compat_ossl.html
关于curl - NSS : client certificate not found (nickname not specified)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15773806/