[R-SIG-Mac] R / Rstudio and curl on Mac Mojave

kjsch@udt m@iii@g oii sch@udt@us kjsch@udt m@iii@g oii sch@udt@us
Sat Nov 13 17:33:36 CET 2021


Lets Encrypt and curl under Mojave on a Mac:

How does one work around the expiration of the Lets Encrypt  
certificates when running on Mojave?

Under R control, I download a list of stations, select the proper ones  
and download.

station_link = "https://ntl.gcoos.org/station_table.txt"
HtmlLink <- paste(station_link)
dest = paste("data/station_list.txt")
curl_download(url =HtmlLink ,destfile=dest,quiet=FALSE, mode="wb")

This fails due to the certificate issues.

Similarly, system("curl https://ntl.gcoos.org/station_table.txt  
-output table.txt") fails.

However, curl https://ntl.gcoos.org/station_table.txt -output  
table.txt works from the terminal!

Checking versions, I find that the terminal is using curl 7.8.    
system("curl -V") returns curl 7.54.

 From the terminal "which curl" points to curl 7.8 installed by mac ports.

from R, system("which curl") points to curl 7.54 which was installed  
during Mojave installation.

Apparently, "R"  ignores the $PATH statement and looks for the binary  
in /usr/bin/, neither curl from Brew, Macports or Anaconda helped.

Curl makes use of cacert.pem which isn't accepted by the Keychain.

Wiping a disk and building a fresh install did not help.

Updating to Catalina upgraded curl to version 7.80 which fixed the  
problem but killed my 32-bit applications.

Does anyone know a way to force R to follow the $PATH specification?



More information about the R-SIG-Mac mailing list