Very similar to this question. Except I would like to know how to make a GET request with httr when the private key is encrypted?
The following example works fine when certkey.key
is unencrypted.
library(httr)
cafile="ca.pem"
certfile="cert.pem"
keyfile="certkey.key"
r<-GET("https://www.example.com/api/timeseries&firstname=Joe", config(cainfo = cafile, sslcert = certfile, sslkey = keyfile))
For security reasons, I need a solution that does not require an unencrypted keyfile. When certkey.key
is encrypted, the SSL handshake fails with the message:
Error in curl::curl_fetch_memory(url, handle = handle) : SSL connect error
I think this happens because httr does not prompt to ask for a passphrase like you would see when using the analogous curl command. It instead errors out.