我正在尝试使用httr库从需要证书认证的服务器访问数据。我有证书(cert.pem)、密钥文件(key.pem)和根证书(caroot.pem)。
以下curl命令有效:
curl -H "userName:sriharsha@rpc.com" --cert cert.pem --key certkey.key --cacert caroot.pem https://api.somedomain.com/api/v1/timeseries/klog?limit=1
如何在httr GET请求中指定certkey.key和caroot.pem。我正在尝试以下R命令,但找不到指定cert key和caroot的选项。
因此,我正在寻找httr的等效选项,用于curl的(--cert、--key和--cacert)。cafile=???? r<-GET("https://api.somedomain.com/api/v1/timeseries/klog", query = list(limit = 1), add_headers("userName"= "sriharsha@rpc.com"), config(cainfo = cafile, ssl_verifypeer=FALSE), verbose())