pki_enable_httr: Set httr config parameters

Description Usage Arguments Details Examples

View source: R/pki_enable_httr.R

Description

Override configuration settings used by the 'httr' package to allow working with PKI-enabled web services.

Usage

1
2
3
4
5
6
pki_enable_httr(
  pki_file = NULL,
  ca_file = NULL,
  password = NULL,
  override = FALSE
)

Arguments

pki_file

string: file path to a pki certificate

ca_file

string: file path to a Certificate Authority (CA) bundle

password

string: passphrase used to encrypt/decrypt the private key of the PKI certificate

override

logical: force override of a pre-existing mypki configuration file if found.

Details

Default mypki configuration settings will be used unless otherwise specified. The PKI certificate file must be in PKCS#12 format. The following httr::config settings are modified: cainfo, sslcert, sslkey.

If a mypki configuration file cannot be found, users are prompted for filepaths to a PKI certificate and a Certificate Authority (CA) bundle.

Examples

1
2
3
4
5
6
7
8
9
library(rpki)
pki_enable_httr() # will prompt for passphrase
GET("http://httpbin.org/")

library(rpki)
pki_enable_httr(pki_file = "my_pki.p12",
                ca_file = "my_ca.crt",
                password = "my_pki_passphrase")
GET("http://httpbin.org/")

nbgallery/rpki documentation built on Sept. 2, 2020, 2:08 a.m.