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.
当前回答
下载https://curl.haxx.se/ca/cacert.pem 下载后,将该文件移动到wamp服务器。 对于exp: D:\wamp\bin\php\ 然后在底部的php.ini文件中添加以下代码行。
curl.cainfo=“D:\wamp\bin\php\cacert.pem”
现在重新启动wamp服务器。
其他回答
它失败了,因为cURL无法验证服务器提供的证书。
有两个选项可以让它工作:
使用带-k选项的cURL,允许cURL建立不安全的连接,即cURL不验证证书。 将根CA(签署服务器证书的CA)添加到/etc/ssl/certs/ca-certificates.crt
您应该使用选项2,因为它是确保您连接到安全FTP服务器的选项。
您必须将服务器证书从cert.pem更改为fullchain.pem 我有同样的问题与Perl HTTPS守护进程: 我已经改变了: SSL_cert_file => '/etc/letsencrypt/live/mydomain/cert.pem' : SSL_cert_file => '/etc/letsencrypt/live/mydomain/fullchain.pem'
我本想评论Yuvik的回答,但我缺乏足够的声誉点。
当您将.crt文件导入到/usr/share/local/ca-certificates时,需要使用正确的格式。其中一些已经在前面提到过,但是还没有人提到只需要一个新的行字符,也没有人收集过清单,所以我想在这里提供一个清单。
The certificate needs to end in .crt. From Ubuntu's man page: Certificates must have a .crt extension in order to be included by update-ca-certificates Certificate files in /usr/local/share/ca-certificates can only contain one certificate Certificate files must end in a newline. update-ca-certificates will appear to work if each row contains, for example, a carriage return + a newline (as is standard in Windows), but once the certificate is appended to /etc/ssl/ca-certificates.crt, it still will not work. This specific requirement bit me as we're loading certificates from an external source.
这是ssh证书存储问题。请先从目标CA网站下载有效的证书pem文件,再构建软链接文件指示ssl信任证书。
openssl x509 -hash -noout -in DigiCert_Global_Root_G3.pem
您将得到dd8e9d41
使用散列号构建solf链接,并以.0(点- 0)作为文件后缀
DD8E9D41.0
然后再试一次。
关于“SSL证书问题:无法获得本地颁发者证书”错误。需要注意的是,这适用于发送CURL请求的系统,而不是接收请求的服务器。
Download the latest cacert.pem from https://curl.se/ca/cacert.pem Add the '--cacert /path/to/cacert.pem' option to the curl command to tell curl where the local Certificate Authority file is. (or) Create or add to a '.curlrc' file the line: cacert = /path/to/cacert.pem See 'man curl', the section about the '-K, --config <file>' section for information about where curl looks for this file. (or if using php) Add the following line to php.ini: (if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html).
卷毛。cainfo = " - path / to / downloaded cacert pem。”
请确保将路径用双引号括起来!!
默认情况下,FastCGI进程将每300秒解析一次新文件(如果需要,您可以通过添加几个文件来改变频率https://ss88.uk/blog/fast-cgi-and-user-ini-files-the-new-htaccess/)。
推荐文章
- Ruby Bundle Symbol not found: _SSLv2_client_method (LoadError)
- PHP中的cURL是什么?
- 错误:无法验证nodejs中的第一个证书
- 对bash脚本函数中定义的变量使用curl POST
- 没有为Android SSL连接找到信任锚
- 抓取:SSL: CERTIFICATE_VERIFY_FAILED错误http://en.wikipedia.org
- 使用curl POST multipart/form-data的正确方法是什么?
- 使用.htaccess和mod_rewrite强制SSL/https
- PHP -调试Curl
- (1) libcurl不支持或禁用https协议
- 在尝试访问HTTPS url时,如何使用cURL处理证书?
- 在Java客户端中接受服务器的自签名ssl证书
- 如何使用PHP 7安装ext-curl扩展?
- 如何通过JSON文件传递有效载荷卷曲?
- 编写器安装错误——当它实际启用时需要ext_curl