use*_*540 202 ssl curl openssl ssl-certificate x509certificate
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.
Run Code Online (Sandbox Code Playgroud)
小智 193
与"SSL证书问题:无法获取本地颁发者证书"错误有关.显然这适用于发送CURL请求的系统(并且没有服务器接收请求)
1)从https://curl.haxx.se/ca/cacert.pem下载最新的cacert.pem
2)将以下行添加到php.ini(如果这是共享主机,您无权访问php.ini,那么您可以将其添加到public_html中的.user.ini)
curl.cainfo="/path/to/downloaded/cacert.pem"
确保将路径括在双引号内!
3)默认情况下,FastCGI进程将每300秒解析一次新文件(如果需要,您可以通过添加几个文件来更改频率,如https://ss88.uk/blog/fast-cgi-and-user-ini -files-the-new-htaccess /)
Yuv*_*ika 109
由于cURL无法验证服务器提供的证书,因此失败.
有两种方法可以使其工作:
使用cURL -k选项允许curl进行不安全的连接,即cURL不验证证书.
将根CA(签署服务器证书的CA)添加到 etc/ssl/certs/ca-certificates.crt
您应该使用选项2,因为它是确保您连接到安全FTP服务器的选项.
小智 67
我通过在cURL脚本中添加一行代码解决了这个问题:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Run Code Online (Sandbox Code Playgroud)
警告:这使得请求绝对不安全(请参阅@YSU的回答)!
Dan*_*ous 17
在我的情况下,在我尝试使用cURL使用的服务上安装我的证书时,结果证明是个问题.我无法将中间证书和根证书捆绑/连接到我的域证书中.起初并不是很明显,这是问题所在,因为尽管省略了中间证书和根证书,Chrome仍然将其解决并接受了证书.
捆绑证书后,一切都按预期工作.我捆绑了这样的
$ cat intermediate.crt >> domain.crt
Run Code Online (Sandbox Code Playgroud)
并重复所有中间和根证书.
Rig*_*iga 16
安装Git Extensions v3.48后出现此问题.试图再次安装mysysgit但同样的问题.最后,不得不禁用(请考虑安全隐患!)Git SSL验证:
git config --global http.sslVerify false
Run Code Online (Sandbox Code Playgroud)
但如果您有域名证书,请将其添加到(Win7)
C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
Run Code Online (Sandbox Code Playgroud)
小智 11
我们最近遇到了这个错误.事实证明它与根证书没有正确安装在CA商店目录中有关.我正在使用curl命令直接指定CA dir. curl --cacert /etc/test/server.pem --capath /etc/test ...每次使用curl时此命令都失败:(60)SSL证书问题:无法获得本地颁发者证书.
使用之后strace curl ...,确定curl正在查找名为60ff2731.0的根证书文件,该文件基于openssl哈希命名对话.所以我发现这个命令可以有效地导入根证书:
ln -s rootcert.pem`openssl x509 -hash -noout -in rootcert.pem`.0
这会创建一个软链接
60ff2731.0 - > rootcert.pem
curl,在封面下读取server.pem证书,确定根证书文件(rootcert.pem)的名称,将其转换为其哈希名称,然后执行操作系统文件查找,但找不到它.
因此,需要注意的是,当curl错误模糊不清时运行curl时使用strace(这是一个巨大的帮助),然后确保使用openssl命名约定正确安装根证书.
san*_*mar 11
下载后,将此文件移至您的 wamp 服务器。
对于 exp: D:\wamp\bin\php\
然后将以下行添加到底部的 php.ini 文件中。
curl.cainfo="D:\wamp\bin\php\cacert.pem"
Max*_*ina 10
对我来说,简单安装证书有助于:
sudo apt-get install ca-certificates
Run Code Online (Sandbox Code Playgroud)
根据cURL 文档,您还可以将证书传递给curl命令:
获取可以验证远程服务器的 CA 证书,并在连接时使用正确的选项指出此 CA 证书以进行验证。对于
libcurl黑客:curl_easy_setopt(curl, CURLOPT_CAPATH, capath);使用 curl 命令行工具:
--cacert [file]
例如:
curl --cacert mycertificate.cer -v https://www.stackoverflow.com
Run Code Online (Sandbox Code Playgroud)
它很可能是服务器缺少的证书.
根 - >中程>服务器
服务器应至少发送Server&Intermediate.
使用openssl s_client -showcerts -starttls ftp -crlf -connect abc:21调试问题.
如果只返回一个证书(自签名或已签发),则必须选择:
curl -k(非常糟糕的主意)如果服务器返回多个,但不包括自签名(root)证书:
如果服务器返回了根CA证书,那么它不在您的CA商店中,您的选项是:
我忽略了过期/撤销的证书,因为没有消息表明它.但是你可以用它来检查证书openssl x509 -text
鉴于您正在连接到家庭版(https://www.cerberusftp.com/support/help/installing-a-certificate/)ftp服务器,我将说它是自签名的.
请发布更多详细信息,例如openssl的输出.
我也遇到过这个问题。我已经阅读了这个线程,大多数答案都提供了信息,但对我来说过于复杂。我在网络主题方面没有经验,所以这个答案适合像我这样的人。
就我而言,发生此错误是因为我没有在应用程序中使用的证书旁边包含中间证书和根证书。
这是我从 SSL 证书供应商那里得到的:
- abc.crt
- abc.pem
- abc-bunde.crt
Run Code Online (Sandbox Code Playgroud)
在abc.crt文件中,只有一个证书:
-----BEGIN CERTIFICATE-----
/*certificate content here*/
-----END CERTIFICATE-----
Run Code Online (Sandbox Code Playgroud)
如果我以这种格式提供它,浏览器将不会显示任何错误(Firefox),但是curl: (60) SSL certificate : unable to get local issuer certificate当我执行 curl 请求时会出现错误。
要修复此错误,请检查您的abc-bunde.crt文件。你很可能会看到这样的事情:
-----BEGIN CERTIFICATE-----
/*additional certificate content here*/
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
/*other certificate content here*/
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
/*different certificate content here*/
-----END CERTIFICATE-----
Run Code Online (Sandbox Code Playgroud)
这些是您的中间证书和根证书。发生错误是因为它们在您提供给应用程序的 SSL 证书中丢失。
要修复错误,请按以下格式合并这两个文件的内容:
-----BEGIN CERTIFICATE-----
/*certificate content here*/
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
/*additional certificate content here*/
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
/*other certificate content here*/
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
/*different certificate content here*/
-----END CERTIFICATE-----
Run Code Online (Sandbox Code Playgroud)
请注意,证书之间、文件末尾或开头没有空格。一旦您将这个组合证书提供给您的应用程序,您的问题就应该得到解决。
仅更新证书列表可能就足够了
sudo update-ca-certificates -f
Run Code Online (Sandbox Code Playgroud)
update-ca-certificates 是一个程序,它更新目录 /etc/ssl/certs 以保存 SSL 证书并生成 ca-certificates.crt,这是一个连接的单文件证书列表。
小智 5
输入这两个代码以禁用 SSL 证书问题。经过大量研究,我发现了这一点,它对我有用。
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Run Code Online (Sandbox Code Playgroud)
小智 5
我的工作原理是在我的卷曲中添加 -k 。不需要让事情复杂化。
curl -LOk https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectlRun Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
447298 次 |
| 最近记录: |