1

I'm trying to make an API request and am passing my SSL cert to the config() parameter of GET. I initially got this working for a few weeks but then had to reinstall R. I did a clean install, deleting all folders, installing R, RTools, RStudio. In this new instance of R the same script no longer works. I've uninstalled/reinstalled HTTR, curl, openssl and no luck still (I've also reinstalled R multiple times).

This is the get request code:

conn <- GET(url = "testurl",
               add_headers(header2),
               config(sslcert =  "my_cert.pem", sslkey = "my_key.pem"),
               content_type_json(),
               accept_json())

Where my_cert.pem and my_key.pem were parsed from openssl by:

cert <- openssl::read_p12(file = "Data/certificate.pfx", password = "somepassword")

my_cert.pem <- write_pem(cert$cert)

my_key.pem <-  write_pem(cert$key)

These are the versions I'm using: R version: 4.2.2, RStudio:: 2022.07.2 - 576 rtools42-5355-5357 openssl 2.0.4 curl: 4.3.3 httr: 1.4.4

tpscp
  • 49
  • 6

0 Answers0