cURL error 60: SSL certificate problem: certificate has expired

WordPress has a function download_url that can download a file(such as an image) from remote site. I got this “cURL error 60: SSL certificate problem: certificate has expired” error when downloading from some sites. Apparently this is related to ssl certificate. Interestingly, I can download the file manually in a browser, and it does not complainĀ  certificate error. I am calling this function as:

download_url(“https://myprogrammingnotes.com/test.png”)

The third parameter signature_verification of download_url is defaulted to false, which seems to mean it does not verification the certificate. But this is not true. In fact, WordPress will use the file http://yoursite.com/wp-includes/certificates/ca-bundle.crt to verify the certificate of myprogrammingnotes.com. And the error arises due to the outdatedĀ  ca-bundle.crt.

The solution is to get the latest ca-bundle.crt to replace the outdated one. The fresh ca-bundle.crt can be downloaded from https://curl.se/ca/cacert.pem. Just rename the downloaded cacert.pem to ca-bundle.crt, and replace http://yoursite.com/wp-includes/certificates/ca-bundle.crt with it.

There is a WordPress plugin that can fix the error automatically so you do not need to update the certificate manually.

Reference:https://wordpress.org/support/topic/curl-error-60-ssl-certificate-problem-certificate-has-expired-9/

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply