r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
639 stars 56 forks source link

pak cannot download from repos with self-issued certificates #647

Open maxheld83 opened 2 weeks ago

maxheld83 commented 2 weeks ago

this works:

pak::pkg_install("git::https://github.com/tidyverse/ggplot2.git")

this fails:

pak::pkg_install("git::https://hooli.local/foo/bar.git") # website with self-issued certificate

with

Error:                                                                                                          
! error in pak subprocess
Caused by error: 
! Could not solve package dependencies:
* git::https://hooli.local/foo/bar.git: ! pkgdepends resolution error for git::https://hooli.local/foo/bar.git.
Caused by error: 
! Failed to download DESCRIPTION from git repo at <https://hooli.local/foo/bar.git>.
Caused by error in `(function (e) …`:
! SSL certificate problem: unable to get local issuer certificate
Type .Last.error to see the more details.

this works:

curl https://hooli.local/foo/bar

this works:

remotes::install_git("https://hooli.local/foo/bar.git)"

I have placed the self-issued certificate into /etc/ssl/certs and then run sudo update-ca-certificates.

I've also set options(async_http_cainfo = "/etc/ssl/certs") in my .Rprofile to override the certificates that pak ships with.

This is hard to debug, because I don't have ready access to a share-able website with a self-issued certificate, and I know this is usually/probably a user issue.

It's odd however, that curl otherwise works, but pak doesn't, even options(async_http_cainfo = "/etc/ssl/certs"). Is there any other way in which pak and curl calls still differ when this option is set?