-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classed TLS configuration #120
Comments
@shikokuchuo, I almost have this implemented, except for the issues at shikokuchuo/mirai#76 (reply in thread). I still seem to have trouble supplying a password for an encrypted key in a way that functions. All the relevant tests I can think of are https://github.com/wlandau/crew/blob/120/tests/tls/test-crew_tls.R, and most are failing.
Lines 220 to 229 in 0bd39b1
and builds the Line 331 in 0bd39b1
|
I think the solution is to expose it as an argument - for user to supply a function - with the default value of NULL. Unless you want to customise this behaviour, in which case you need to export a function from |
I was trying to generate this function inside system(
paste(
"openssl genpkey -out fd.key -algorithm RSA -outform PEM",
"-pkeyopt rsa_keygen_bits:2048 -des3 -pass pass:crew"
)
)
system(
paste(
"openssl req -new -key fd.key -out fd.csr",
"-subj \"/CN=127.0.0.1\" -passin pass:crew"
)
)
system(
paste(
"openssl x509 -req -days 365 -in fd.csr -signkey",
"fd.key -out fd.crt -passin pass:crew"
)
)
get_password <- function() {
"crew"
}
mirai::daemons(
n = 1L,
url = "wss://127.0.0.1:0",
dispatcher = TRUE,
seed = NULL,
tls = c(
paste(readLines("fd.crt"), collapse = "\n"),
paste(readLines("fd.key"), collapse = "\n")
),
pass = get_password(),
token = TRUE,
.compute = "name"
) |
In a nutshell, the function you supply to 'pass' in your So the above becomes It is only evaluated on dispatcher. As this is a new process, there is no But I think in reality all you can do is expose the argument and document that they need to use something like |
I think
crew
needs an R6 class to manage TLS configuration inmirai
, given how complicated it is to configure TLS and how the interface might change in the future.The text was updated successfully, but these errors were encountered: