Skip to main content

Introduction to Data Science Version 3

Section 11.4 Getting New SSL Tokens on Windows

For Windows users, depending upon which version of operating system software you are using as well as your upgrade history, it may be necessary to provide new SSL certificates. Certificates help to maintain secure communications across the Internet, and most computers keep an up-to-date copy on file, but not all of them do. If you encounter any problems using R to access the Internet, you may need new tokens.
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")
This statement needs to be run before the R tries to contact Twitter for authentication. This is because twitteR uses RCurl which in turn employs SSL security whenever โ€œhttpsโ€ appears in a URL. The command above downloads new certificates and saves them within the current working directory for R. You may need to use cacert.pem for many or most of the function calls to twitteR by adding the argument cainfo="cacert.pem".