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.

当前回答

输入这两个代码以禁用SSL证书颁发。这对我很有效 经过大量研究,我发现了这个。

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

其他回答

仅仅更新证书列表可能就足够了

sudo update-ca-certificates -f

update-ca-certificates是一个更新/etc/ssl/certs目录以保存SSL证书并生成ca-certificates的程序。Crt,一个连接的证书单文件列表。

是的,您还需要添加一个CA证书。在Node.js中添加一个代码片段以获得更清晰的视图。

var fs = require(fs)
var path = require('path')
var https = require('https')
var port = process.env.PORT || 8080;
var app = express();

https.createServer({
key: fs.readFileSync(path.join(__dirname, './path to your private key/privkey.pem')),
cert: fs.readFileSync(path.join(__dirname, './path to your certificate/cert.pem')),
ca: fs.readFileSync(path.join(__dirname, './path to your CA file/chain.pem'))}, app).listen(port)

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

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

测试在guzzle/guzzle 3.*

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

由于conda环境,一些系统可能存在此问题。如果你安装了conda,那么禁用它可以解决你的问题。在我的情况下,当我停用conda时,这个curl-SSL错误得到了解决。在ubuntu或MacOS上试试这个命令

conda deactivate