user1721180
user1721180

Reputation: 125

Failed to install R libraries - SSL issues?

Everything I try to download a library from R I get "Error: Failed to install 'unknown package' from URL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version"

E.g., I try

install_version("cowplot")

or

remotes::install_github("kassambara/factoextra")

How to solve this?

Upvotes: 0

Views: 1514

Answers (2)

user1721180
user1721180

Reputation: 125

Ended up upgrading through homebrew the entire R distribution including all its dependencies. Call it dependency hell :-)

The part that took the longest and that fixed the problem was that of upgrading to the latest GCC which ends up breaking a number of packages.

Upvotes: 0

user10307643
user10307643

Reputation:

You have to check that the SSL client and the SSL server have a common combination of protocol / algorithm to start the connection. Otherwise the connection fails.

Note that more and more TLS 1.0 and 1.1 are forbidden by servers (not secure enough): for instance, GitHub has only TLS 1.2 and 1.3.

You can check the server using this online tool: https://github.com/openssl/openssl/issues/5806.

To check the client, you will have to find out which version of OpenSSL is used by your version of R (or maybe provided by the OS). OpenSSL is only a guess: R may also use libcurl, which may be built with another SSL library, but they all should support TLS 1.2 (at least the recent versions of these libraries).

Upgrading R and/or OpenSSL to the latests versions should solve the issue, but there is another possibility. Note that cowplot is on CRAN here, and it has the latest release.

Here you are using install_version from devtools. Why not use the builtin R functions for package installation? Set the repository in R using for instance options(repos="https://cran.r-project.org/") and install the package with install.packages("cowplot"). The main CRAN mirror, https://cran.r-project.org/, supports older versions of TLS (1.0 and 1.1), so it should work.

See also these links:

Upvotes: 0

Related Questions