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.

当前回答

是的,您还需要添加一个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)

其他回答

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

openssl x509 -hash -noout -in DigiCert_Global_Root_G3.pem

您将得到dd8e9d41

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

DD8E9D41.0

然后再试一次。

简单的解决方案: 在~ /。Sdkman /etc/config, change sdkman_insecure_ssl=true

步骤: 纳米~ / .sdkman / etc /配置 将sdkman_insecure_ssl=false修改为sdkman_insecure_ssl=true 保存并退出

尝试在Ubuntu中重新安装curl,并使用sudo update-ca-certificates—fresh更新我的CA证书

对我来说,简单地安装证书有帮助:

sudo apt-get install ca-certificates

在亚马逊Linux (CentOS / Red Hat等)上,我做了以下工作来解决这个问题。首先复制cacert。Pem从http://curl.haxx.se/ca/cacert.pem下载,放在/etc/pki/ca-trust/source/anchors/目录下。执行update-ca-trust命令。

下面是来自https://serverfault.com/questions/394815/how-to-update-curl-ca-bundle-on-redhat的一句话

Curl https://curl.se/ca/cacert.pem -o /etc/pki/ca-trust/source/anchors/curl-cacert-updated。Pem && update-ca-trust

然而,由于curl被破坏,我实际上使用这个命令来下载cacert。pem文件。

Wget——no-check-certificate http://curl.haxx.se/ca/cacert.pem

另外,如果你在使用php时遇到了问题,你可能需要重新启动你的web服务器服务httpd restart for apache或service nginx restart for nginx。