API request and Error in curl::curl_fetch_memory(url, handle = handle) : SSL certificate problem: certificate has expired

我只是一个虾纸丫 提交于 2020-06-13 05:44:07

问题


I was running the code for months without any issues, and couple days before.

GET(url="myurl", query)

Today I've got an error

Error in curl::curl_fetch_memory(url, handle = handle) :    
SSL certificate problem: certificate has expired

The SSL cert on the site is active and ends in a year.

Also the same GET request is working via browser....

What is the issue? 🤷‍♂️


回答1:


Try testing your server with this tool: https://www.ionos.com/tools/ssl-checker and see if it says that it is "not installed correctly".

If you find that it has been working historically but recently stopped, you likely have an invalid chain of trust. Recently, a common root CA certificate expired. Your server may be using this and sending it as part of it's chain of certificates it sends to clients. If that is the case, and it is this recently-expired root CA, your fix will most likely look like removing that root certificate from your bundle. So you'd include the intermediate certificates still, but exclude the root. You can then use these tools to revalidate if things are setup correctly.

You can also see the chain and some of the validity information using this tool: https://www.sslshopper.com/ssl-checker.html



来源:https://stackoverflow.com/questions/62139904/api-request-and-error-in-curlcurl-fetch-memoryurl-handle-handle-ssl-cer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!