I've updated GIFT to the last available version and I'm having trouble because of a recurrent error with SSL certificates (see reprex below).
As this error is triggered when checking the GIFT versions, it means that I cannot perform any query to GIFT as almost all functions check for GIFT versions before performing their queries.
I've checked that it is working when I'm asking explicitly to ignore the SSL certificate.
What's very strange to me is that the "problematic" URL https://gift.uni-goettingen.de/api/index.php?query=versions works very fine in my browser. And when checking the certificate details, it seems fine. I'm no expert there, but maybe you could ask the IT folks that are hosting the GIFT API?
LAST MINUTE EDIT: It seems it may be due to the old age of my computer and OS, because it comes preloaded with certificates to authenticate SSL certificates. When using a browser, the browser uses its own certificates to check authenticity. While when using R, it's using the OS ones, which are quite old in my case. I'll check on another computer and tell you.
LAST MINUTE RE-EDIT: Yes it seems to be caused by my old OS and doesn't cause issues with newer ones. A probable workaround is to manually add the SSL certificate to my OS (I'm unsure how to do that but I'll figure out).
Reprex :
# Load package
library("GIFT")
# Check installed version
sessioninfo::package_info("GIFT", dependencies = FALSE)
#> package * version date (UTC) lib source
#> GIFT * 1.2.0 2023-08-17 [1] CRAN (R 4.2.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library
# Check error
GIFT::GIFT_versions()
#> Warning in open.connection(con, "rb"): URL
#> 'https://gift.uni-goettingen.de/api/index.php?query=versions': statut 'Peer
#> certificate cannot be authenticated with given CA certificates'
#> Error in open.connection(con, "rb"): impossible d'ouvrir la connexion vers 'https://gift.uni-goettingen.de/api/index.php?query=versions'
# Problematic URL
api_request = "https://gift.uni-goettingen.de/api/index.php?query=versions"
# Check with httr
httr::GET(api_request)
#> Error in curl::curl_fetch_memory(url, handle = handle): Peer certificate cannot be authenticated with given CA certificates: [gift.uni-goettingen.de] SSL certificate problem: certificate has expired
# Check with httr2
httr2::req_perform(httr2::request(api_request))
#> Error:
#> ! Peer certificate cannot be authenticated with given CA certificates: [gift.uni-goettingen.de] SSL certificate problem: certificate has expired
#> Backtrace:
#> ▆
#> 1. └─httr2::req_perform(httr2::request(api_request))
#> 2. └─base::tryCatch(...)
#> 3. └─base (local) tryCatchList(expr, classes, parentenv, handlers)
#> 4. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
#> 5. └─value[[3L]](cond)
# Check with curl
readLines(curl::curl(api_request))
#> Error in readLines(curl::curl(api_request)): Peer certificate cannot be authenticated with given CA certificates: [gift.uni-goettingen.de] SSL certificate problem: certificate has expired
# Apparently it's a problem with an SSL certificate
# (which seems fine when checking on a browser)
# Ignore SSL certificate
ko = httr2::req_perform(
httr2::req_options(
httr2::request(api_request), ssl_verifypeer = 0
)
)
# Works!
str(httr2::resp_body_json(ko), max.level = 1)
#> List of 5
#> $ :List of 6
#> $ :List of 6
#> $ :List of 6
#> $ :List of 6
#> $ :List of 6
Hey :)
I've updated GIFT to the last available version and I'm having trouble because of a recurrent error with SSL certificates (see reprex below). As this error is triggered when checking the GIFT versions, it means that I cannot perform any query to GIFT as almost all functions check for GIFT versions before performing their queries. I've checked that it is working when I'm asking explicitly to ignore the SSL certificate.
What's very strange to me is that the "problematic" URL https://gift.uni-goettingen.de/api/index.php?query=versions works very fine in my browser. And when checking the certificate details, it seems fine. I'm no expert there, but maybe you could ask the IT folks that are hosting the GIFT API?
LAST MINUTE EDIT: It seems it may be due to the old age of my computer and OS, because it comes preloaded with certificates to authenticate SSL certificates. When using a browser, the browser uses its own certificates to check authenticity. While when using R, it's using the OS ones, which are quite old in my case. I'll check on another computer and tell you.
LAST MINUTE RE-EDIT: Yes it seems to be caused by my old OS and doesn't cause issues with newer ones. A probable workaround is to manually add the SSL certificate to my OS (I'm unsure how to do that but I'll figure out).
Reprex :
Created on 2023-10-04 with reprex v2.0.2
Session info
``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.2.1 (2022-06-23) #> os macOS High Sierra 10.13.6 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate fr_FR.UTF-8 #> ctype fr_FR.UTF-8 #> tz Europe/Paris #> date 2023-10-04 #> pandoc 2.14.0.3 @ /Applications/RStudio.app/Contents/MacOS/pandoc/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> ape 5.6-2 2022-03-02 [1] CRAN (R 4.1.2) #> class 7.3-20 2022-01-16 [1] CRAN (R 4.2.1) #> classInt 0.4-8 2022-09-29 [1] CRAN (R 4.2.0) #> cli 3.6.0 2023-01-09 [1] CRAN (R 4.2.0) #> clusterGeneration 1.3.7 2020-12-15 [1] CRAN (R 4.0.3) #> coda 0.19-4 2020-09-30 [1] CRAN (R 4.0.2) #> codetools 0.2-18 2020-11-04 [1] CRAN (R 4.2.1) #> combinat 0.0-8 2012-10-29 [1] CRAN (R 4.0.2) #> curl 5.0.0 2023-01-12 [1] CRAN (R 4.2.0) #> DBI 1.1.3 2022-06-18 [1] CRAN (R 4.1.2) #> digest 0.6.30 2022-10-18 [1] CRAN (R 4.2.0) #> dplyr 1.1.0 2023-01-29 [1] CRAN (R 4.2.0) #> e1071 1.7-12 2022-10-24 [1] CRAN (R 4.2.0) #> evaluate 0.17 2022-10-07 [1] CRAN (R 4.2.0) #> expm 0.999-6 2021-01-13 [1] CRAN (R 4.0.3) #> fansi 1.0.4 2023-01-22 [1] CRAN (R 4.2.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.3) #> fastmatch 1.1-3 2021-07-23 [1] CRAN (R 4.0.3) #> fs 1.5.2 2021-12-08 [1] CRAN (R 4.0.2) #> generics 0.1.3 2022-07-05 [1] CRAN (R 4.1.2) #> GIFT * 1.2.0 2023-08-17 [1] CRAN (R 4.2.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.1.2) #> highr 0.9 2021-04-16 [1] CRAN (R 4.0.3) #> htmltools 0.5.3 2022-07-18 [1] CRAN (R 4.1.2) #> httr 1.4.4 2022-08-17 [1] CRAN (R 4.1.2) #> httr2 0.2.3 2023-05-08 [1] CRAN (R 4.2.0) #> igraph 1.3.5 2022-09-22 [1] CRAN (R 4.2.0) #> jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.2.0) #> KernSmooth 2.23-20 2021-05-03 [1] CRAN (R 4.2.1) #> knitr 1.40 2022-08-24 [1] CRAN (R 4.2.1) #> lattice 0.20-45 2021-09-22 [1] CRAN (R 4.2.1) #> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.1.2) #> maps 3.4.1 2022-10-30 [1] CRAN (R 4.2.1) #> MASS 7.3-58.1 2022-08-03 [1] CRAN (R 4.2.0) #> Matrix 1.5-1 2022-09-13 [1] CRAN (R 4.2.0) #> mnormt 2.1.1 2022-09-26 [1] CRAN (R 4.2.0) #> nlme 3.1-160 2022-10-10 [1] CRAN (R 4.2.0) #> numDeriv 2016.8-1.1 2019-06-06 [1] CRAN (R 4.0.2) #> optimParallel 1.0-2 2021-02-11 [1] CRAN (R 4.2.0) #> phangorn 2.10.0 2022-09-18 [1] CRAN (R 4.2.0) #> phytools 1.2-0 2022-09-01 [1] CRAN (R 4.2.0) #> pillar 1.8.1 2022-08-19 [1] CRAN (R 4.1.2) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2) #> plotrix 3.8-2 2021-09-08 [1] CRAN (R 4.0.2) #> proxy 0.4-27 2022-06-09 [1] CRAN (R 4.1.2) #> purrr 1.0.1 2023-01-10 [1] CRAN (R 4.2.0) #> quadprog 1.5-8 2019-11-20 [1] CRAN (R 4.0.2) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.1.2) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.1.2) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.1.2) #> R.utils 2.12.1 2022-10-30 [1] CRAN (R 4.2.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.0.2) #> rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.0.2) #> Rcpp 1.0.10 2023-01-22 [1] CRAN (R 4.2.0) #> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.1.2) #> rlang 1.0.6 2022-09-24 [1] CRAN (R 4.2.0) #> rmarkdown 2.17 2022-10-07 [1] CRAN (R 4.2.0) #> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.1.2) #> scatterplot3d 0.3-42 2022-09-08 [1] CRAN (R 4.2.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.0.2) #> sf 1.0-8 2022-07-14 [1] CRAN (R 4.1.2) #> stringi 1.7.12 2023-01-11 [1] CRAN (R 4.2.0) #> stringr 1.5.0 2022-12-02 [1] CRAN (R 4.2.0) #> styler 1.8.0 2022-10-22 [1] CRAN (R 4.2.0) #> tibble 3.1.8 2022-07-22 [1] CRAN (R 4.1.2) #> tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.2.0) #> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.2.0) #> units 0.8-0 2022-02-05 [1] CRAN (R 4.1.2) #> utf8 1.2.3 2023-01-31 [1] CRAN (R 4.2.0) #> vctrs 0.5.2 2023-01-23 [1] CRAN (R 4.2.0) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.1.2) #> xfun 0.34 2022-10-18 [1] CRAN (R 4.2.0) #> yaml 2.3.6 2022-10-18 [1] CRAN (R 4.2.0) #> #> [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library #> #> ────────────────────────────────────────────────────────────────────────────── ```