Create an R6
object with transport layer security (TLS)
configuration for crew
.
Arguments
- mode
Character of length 1. Must be one of the following:
"none"
: disable TLS configuration."automatic"
: letmirai
create a one-time key pair with a self-signed certificate."custom"
: manually supply a private key pair, an optional password for the private key, a certificate, an optional revocation list.
- key
If
mode
is"none"
or"automatic"
, thenkey
isNULL
. Ifmode
is"custom"
, thenkey
is a character of length 1 with the file path to the private key file.- password
If
mode
is"none"
or"automatic"
, thenpassword
isNULL
. Ifmode
is"custom"
and the private key is not encrypted, thenpassword
is stillNULL
. Ifmode
is"custom"
and the private key is encrypted, thenpassword
is a character of length 1 the the password of the private key. In this case, DO NOT SAVE THE PASSWORD IN YOUR R CODE FILES. See thekeyring
R package for solutions.- certificates
If
mode
is"none"
or"automatic"
, thencertificates
isNULL
. Ifmode
is"custom"
, thencertificates
is a character vector of file paths to certificate files (signed public keys). If the certificate is self-signed or if it is directly signed by a certificate authority (CA), then only the certificate of the CA is needed. But if you have a whole certificate chain which begins at your own certificate and ends with the CA, then you can supply the whole certificate chain as a character vector which begins at your own certificate and ends with the certificate of the CA.- validate
Logical of length 1, whether to validate the configuration object on creation. If
FALSE
, thenvalidate()
can be called later on.
Details
crew_tls()
objects are input to the tls
argument of
crew_client()
, crew_controller_local()
, etc.
See https://wlandau.github.io/crew/articles/risks.html for details.
See also
Other tls:
crew_class_tls
Examples
crew_tls(mode = "automatic")
#> <crew_class_tls>
#> Public:
#> certificates: active binding
#> client: function ()
#> initialize: function (mode = NULL, key = NULL, password = NULL, certificates = NULL)
#> key: active binding
#> mode: active binding
#> password: active binding
#> validate: function (test = TRUE)
#> worker: function (name)
#> Private:
#> .certificates: NULL
#> .key: NULL
#> .mode: automatic
#> .password: NULL
#> .read_certificates: function ()
#> .read_files: function (files)
#> .read_key: function ()
#> .validate_mode_automatic: function ()
#> .validate_mode_custom: function ()