I am having difficulty with a GET call that pings the US Naval Observatory API. This request was previously working, but now is failing for unknown reasons.
Here's the request:
library(httr)
#ping API
try(RETRY("GET", url = "http://api.usno.navy.mil/rstt/oneday?date=07/10/2018&coords=41.2792778,%20-96.06442261&tz=-5", times = 20))
#ERROR MESSAGE (request always times out with error)
#Error in curl::curl_fetch_memory(url, handle = handle): SSL certificate problem: #unable to get local issuer certificate
#Request failed [ERROR]. Retrying in 1 seconds...
I am running R v3.5.1 and RStudio v1.1.463. Curl is v3.2 and httr is v1.3.1.
What I have tried for troubleshooting that did not work:
- Double-checking US Naval Observatory API documentation to make sure the request is still correct/up-to-date (it is).
- Installing a previous version of R (v.3.4.4) that this call worked on (no change).
- Updating to latest version of RStudio (v.1.1.463, no change)
- Solution listed at this site (quantmod - SSL: unable to get local issuer certificate in R) which made no change. This is the only relevant thread for this error in R I could find online.
Any ideas fellow R users? Any help or points in the right direction is greatly appreciated!