From: Fuad Muhic Date: Tue, 27 Mar 2018 09:57:35 +0000 (+0200) Subject: When env variable ARVADOS_API_HOST_INSECURE is set HTTP client will not try to valida... X-Git-Tag: 1.2.0~202^2~8 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/9bb169138470dbb176af7e891d6da2089950354b When env variable ARVADOS_API_HOST_INSECURE is set HTTP client will not try to validate the server's TLS certificate. Arvados-DCO-1.1-Signed-off-by: Fuad Muhic --- diff --git a/sdk/R/R/HttpRequest.R b/sdk/R/R/HttpRequest.R index 2a5c4fa556..149ec0db7a 100644 --- a/sdk/R/R/HttpRequest.R +++ b/sdk/R/R/HttpRequest.R @@ -21,13 +21,17 @@ HttpRequest <- R6::R6Class( if(!(verb %in% self$validVerbs)) stop("Http verb is not valid.") - headers <- httr::add_headers(unlist(headers)) urlQuery <- self$createQuery(queryParams) url <- paste0(url, urlQuery) + config <- httr::add_headers(unlist(headers)) + if(toString(Sys.getenv("ARVADOS_API_HOST_INSECURE") == "TRUE")) + config$options = list(ssl_verifypeer = FALSE) + + print(config) # times = 1 regular call + numberOfRetries response <- httr::RETRY(verb, url = url, body = body, - config = headers, times = retryTimes + 1) + config = config, times = retryTimes + 1) }, createQuery = function(queryParams)