When env variable ARVADOS_API_HOST_INSECURE is set HTTP client will not try to valida...
[arvados.git] / sdk / R / R / HttpRequest.R
index 2a5c4fa556817f6ae650674ddeced7ab7026cf7a..149ec0db7ae5f655bec60893c590ee7bf584a84a 100644 (file)
@@ -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)