root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt
* About to connect() to {abc} port 21 (#0)
*   Trying {abc}...
* Connected to {abc} ({abc}) port 21 (#0)
< 220-Cerberus FTP Server - Home Edition
< 220-This is the UNLICENSED Home Edition and may be used for home, personal use only
< 220-Welcome to Cerberus FTP Server
< 220 Created by Cerberus, LLC
> AUTH SSL
< 234 Authentication method accepted
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

当前回答

没有一个答案提到,可能是连接到内部vpn的角色,我以前遇到过这个问题,并要求在专用网络上

其他回答

在我的情况下,当我使用NodeJS设置SSl web服务器时,问题是因为我没有附加Bundle文件证书,最后我通过添加以下文件解决了这个问题:

注:代码来自aboutssl.org

var https = require('https');
var fs = require('fs');
var https_options = {
key: fs.readFileSync("/path/to/private.key"),
cert: fs.readFileSync("/path/to/your_domain_name.crt"),
ca: [
fs.readFileSync('path/to/CA_root.crt'),
fs.readFileSync('path/to/ca_bundle_certificate.crt') // this is the bundle file
]
};
https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("Welcome to Node.js HTTPS Servern");
}).listen(8443)

在上面的文本中,用下面的粗体替换。

/ /私有道路。key -这是您的私钥文件的路径。

路径/ / your_domain_name。crt -输入SSL证书文件的路径。

路径/ / CA_root。crt - CA根证书文件的全路径。

path/to/ca_bundle_certificate——这是你上传的CA包文件的完整路径。

参考:https://aboutssl.org/how-to-install-ssl-certificate-on-node-js/

根据cURL文档,您还可以将证书传递给cURL命令:

获取可以验证远程服务器的CA证书并使用 适当的选项指出此CA证书进行验证时 连接。对于libcurl黑客:curl_easy_setopt(curl, CURLOPT_CAPATH capath); 使用curl命令行工具:——cacert[文件]


例如:

curl --cacert mycertificate.cer -v https://www.stackoverflow.com

这是ssh证书存储问题。请先从目标CA网站下载有效的证书pem文件,再构建软链接文件指示ssl信任证书。

openssl x509 -hash -noout -in DigiCert_Global_Root_G3.pem

您将得到dd8e9d41

使用散列号构建solf链接,并以.0(点- 0)作为文件后缀

DD8E9D41.0

然后再试一次。

我们最近遇到了这个错误。事实证明,这与根证书没有正确安装在CA存储目录有关。我使用了一个curl命令,其中我直接指定了CA目录。Curl——cacert /etc/test/server。—capath /etc/test…此命令每次都失败,curl: (60) SSL证书问题:无法获得本地颁发者证书。

在使用strace curl…根据openssl哈希命名约定,curl正在查找名称为60ff2731.0的根证书文件。所以我发现这个命令可以有效地导入根证书:

Ln -s rootcert。pem的openssl x509散列-noout——rootcert.pem ' 0

哪个会创建软链接

60f2731.0 ->找到脚

卷曲,在被子下读取服务器。pem,确定根证书文件的名称(rootcert.pem),将其转换为其哈希名称,然后进行操作系统文件查找,但无法找到它。

因此,结论是,当curl错误很模糊时,在运行curl时使用strace(这是一个巨大的帮助),然后确保使用openssl命名约定正确安装根证书。

特别对于Windows用户,使用curl-7.57.0-win64-mingw或类似版本。

这有点晚了,现有的答案是正确的。但我还是得费点劲才能让它在我的Windows电脑上运行,不过这个过程其实相当简单。所以,分享一步一步的过程。

这个错误基本上意味着,curl无法验证目标URI的证书。如果您信任证书的颁发者(CA),则可以将其添加到受信任证书列表。

为此,浏览URI(例如在Chrome上)并遵循步骤

Right click on the secure padlock icon Click on certificate, it'll open a window with the certificate details Go to 'Certification Path' tab Click the ROOT certificate Click View Certificate, it'll open another certificate window Go to Details tab Click Copy to File, it'll open the export wizard Click Next Select 'Base-64 encoded X.509 (.CER)' Click Next Give a friendly name e.g. 'MyDomainX.cer' (browse to desired directory) Click Next Click Finish, it'll save the certificate file Now open this .cer file and copy the contents (including -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----) Now go to the directory where curl.exe is saved e.g. C:\SomeFolder\curl-7.57.0-win64-mingw\bin Open the curl-ca-bundle.crt file with a text editor Append the copied certificate text to the end of the file. Save

现在,您的命令应该在curl中正常执行。