![](/img/trans.png)
[英]Download failed. cURL error 60: SSL certificate problem: certificate has expired
[英]cURL error 60: SSL certificate problem: certificate has expired
我們在亞馬遜 EC2 上運行 2 個應用程序( backend.example.com
和frontend.example.com
)。 對於該應用程序,我們使用了付費的 SSL 證書。 該證書到期日期為2021 年 6 月。 但是今天,我們遇到了一個錯誤——
cURL error 60: SSL certificate problem: certificate has expired (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
我們檢查證書到期日期,但沒有問題( 2021 年 6 月)。 然后我們按照這個線程 - curl: (60) SSL 證書問題:無法獲得本地頒發者證書(@Dahomz 回答)
After that, when we curl example.com
by - curl -v --url https://backend.example.com --cacert /etc/ssl/ssl.cert/cacert.pem
, It working fine. 回應如 -
* Rebuilt URL to: https://backend.example.com/
* Trying 127.0.0.1...
* Connected to backend.example.com (127.0.0.1) port 443 (#0)
* found 139 certificates in /etc/ssl/ssl.cert/cacert.pem
* found 600 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ******_RSA_***_***_GCM_*****
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.example.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: OU=Domain Control Validated,OU=PositiveSSL Wildcard,CN=*.example.xyz
* start date: Mon, 04 May 2019 00:00:00 GMT
* expire date: Wed, 07 June 2021 23:59:59 GMT
* issuer: C=GB,ST=Greater Manchester,L=Salford,O=Sectigo Limited,CN=Sectigo RSA Domain Validation Secure Server CA
* compression: NULL
* ALPN, server accepted to use http/1.1
但是當我們通過 curl 從frontend.example.com
到backend.example.com
時,它會拋出這個錯誤 -
* Rebuilt URL to: https://backend.example.com/
* Trying 127.0.0.1...
* Connected to backend.example.com (127.0.0.1) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/ssl.cert/cacert.pem
CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / *****-RSA-*****-GCM-******
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.example.com
* start date: Mar 4 00:00:00 2019 GMT
* expire date: Apr 7 23:59:59 2021 GMT
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
* SSL certificate verify result: certificate has expired (10), continuing anyway.
我的 curl 代碼 -
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://backend.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, fopen(public_path("c.log"), 'w'));
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$output = curl_exec($ch);
$error = curl_error($ch);
$info = curl_getinfo($ch);
curl_close($ch);
要解決此問題,請從您的域證書中刪除過期的根證書。
如果您在 Ubuntu 16 系統上遇到“卷曲”(或類似問題)問題,以下是我們修復它的方法:
在 Ubuntu 16 系統托管 curl / 應用程序失敗:
對於 ubuntu 14.04
打開你的終端
sudo su
wget https://support.sectigo.com/Com_KnowledgeDetailPage?Id=kA01N000000rfBO -O SHA-2_Root_USERTrust_RSA_Certification_Authority.crt --no-check-certificate
cp SHA-2_Root_USERTrust_RSA_Certification_Authority.crt /usr/share/ca-certificates/mozilla/
然后dpkg-reconfigure ca-certificates
並取消選中 mozilla/AddTrust_External_Root.crt並檢查mozilla/2_Root_USERTrust_RSA_Certification_Authority.crt
或運行sudo update-ca-certificates
取消選中這些。
您可以啟用insecure
連接,將此選項添加到您的$HOME/.curlrc
文件:
$ echo "insecure" >> ~/.curlrc
不建議永久保留它,但是,對於快速和臨時的解決方案,這是一個不錯的選擇。
您的信任庫似乎未使用最新的受信任根更新。 了解它從昨天 5 月 30 日開始發生在你身上。 我假設您將 Sectigo 作為您的 CA。
更新您的信任,您應該能夠連接。
昨天我遇到了@finesse 上面報告的問題。 由於在我們的系統上,ca-certificates 會自動更新,因此我很困擾,因為證書是有效的
但它在 web 站點上不起作用。
解決方案很簡單:
只需重新啟動 php-fpm:/
此致,
威利
永久的解決方案是從您的提供商重新頒發 SSL 證書並將其重新安裝到您的服務器上。
重新頒發的證書將更新 CA 包。
干杯!
我們有同樣的錯誤。 為了解決您的問題,請使用您信任的 SSL 站點的最新版本更新您的“SSLCertificateChainFile”。 在我們的例子中是comodo。
您需要 go 到您信任的站點,並在您的證書下找到“CA-CRT”。 復制內容。
如果您無法重啟 apache,簡單的方法是重啟您的實例。
我們遇到了同樣的問題,經過一些故障排除后,我們發現 COMODO 的根證書已過期。
Valid until Sat, 30 May 2020 10:48:38 UTC (expired 3 days, 5 hours ago) EXPIRED
我們通過以下方式對此進行了測試: https://www.ssllabs.com/ssltest/index.html 。 我們通過從經銷商處下載新證書解決了這個問題。
我必須在基於 debian 的服務器上解決此問題
這是由於系統使用了 openssl(卷曲取決於 openssl)
這是怎么回事:
/etc/ssl/certs
中找到)
/etc/ca-certificates.conf
中刪除或注釋“mozilla/AddTrust_External_Root”行sudo update-ca-certificates
更新 openssl 使用的證書也許它可以幫助你?
我設法通過在我的服務器上運行更新來解決問題:
sudo yum update
這似乎解決了 curl 證書的任何問題。
sudo update-ca-certificates
修復了我的問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.