Skip to content

Commit 5894b65

Browse files
authored
Fix tls for http launcher (#573)
* Fix tls for http launcher * Add news item
1 parent c6fb739 commit 5894b65

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# mirai (development version)
22

3+
#### Updates
4+
5+
* Fixes `launch_remote()` with `http_config()` failing for TLS connections, where newlines in the PEM certificate produced invalid JSON in the request payload.
6+
37
# mirai 2.6.1
48

59
#### Updates

R/launchers.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ launch_remote_http <- function(n, remote, url, write_args, dots, envir, tls) {
506506
cmd <- write_args(url, dots, maybe_next_stream(envir), tls)
507507
cmd <- gsub("\\", "\\\\", cmd, fixed = TRUE)
508508
cmd <- gsub("\"", "\\\"", cmd, fixed = TRUE)
509+
cmd <- gsub("\n", "\\n", cmd, fixed = TRUE)
509510
ncurl(
510511
url = api_url,
511512
method = method,

tests/tests.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ connection && NOT_CRAN && {
334334
connection && NOT_CRAN && {
335335
Sys.sleep(0.5)
336336
cfg <- serial_config("custom", function(x) serialize(x, NULL), unserialize)
337-
test_true(daemons(url = host_url(), pass = "test", serial = cfg))
337+
test_true(daemons(url = host_url(tls = TRUE), pass = "test", serial = cfg))
338338
if (.Platform$OS.type == "unix") test_type("character", launch_remote(remote = cluster_config(command = "/bin/sh", options = "#SBATCH", rscript = file.path(R.home("bin"), "Rscript"))))
339339
test_type("list", launch_remote(2L, remote = http_config(url = "http://127.0.0.1:0", data = '{"cmd":"%s"}')))
340340
test_equal(launch_local(1L), 1L)

0 commit comments

Comments
 (0)