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.

当前回答

以我为例,在我试图用cURL使用的服务上安装我的证书时出现了问题。我未能将中间证书和根证书捆绑/连接到我的域证书。一开始并没有明显的问题,因为Chrome解决了这个问题并接受了证书,尽管省略了中间证书和根证书。

在捆绑证书之后,一切都按预期工作。我捆扎成这样

$ cat intermediate.crt >> domain.crt

并对所有中间证书和根证书重复。

其他回答

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

这可以帮助你控制暴饮暴食:

$client = new Client(env('API_HOST'));
$client->setSslVerification(false);

测试在guzzle/guzzle 3.*

这很可能是服务器上丢失的证书。

根- >中间- >服务器

服务器至少应该发送服务器和中间体。

使用openssl s_client -showcerts -starttls ftp -crlf -connect abc:21进行调试。

如果只返回一个证书(自签名或颁发),那么您必须选择:

修复服务器 信任该证书并将其添加到您的CA证书存储(不是最好的主意) 禁用信任,例如curl -k(非常糟糕的主意)

如果服务器返回多个,但不包括自签名(根)证书:

在此链的CA存储中安装CA(根)证书,例如谷歌颁发者。(只有当你信任该CA时) 服务器是否将CA作为链的一部分发送 信任链中的证书 禁用的信任

如果服务器返回一个根CA证书,那么它不在您的CA存储中,您的选项是:

添加(信任)它 禁用的信任

我忽略了过期/撤销的证书,因为没有消息表明它。但是您可以使用openssl x509 -text检查certs

假设您正在连接到家庭版(https://www.cerberusftp.com/support/help/installing-a-certificate/) ftp服务器,我将说它是自签名的。

请发布更多细节,比如来自openssl的输出。

在我的情况下,当我使用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/

下载https://curl.haxx.se/ca/cacert.pem 下载后,将该文件移动到wamp服务器。 对于exp: D:\wamp\bin\php\ 然后在底部的php.ini文件中添加以下代码行。

curl.cainfo=“D:\wamp\bin\php\cacert.pem”

现在重新启动wamp服务器。