Obey ARVADOS_API_HOST_INSECURE
authorTom Clegg <tom@curoverse.com>
Fri, 7 Mar 2014 16:26:52 +0000 (11:26 -0500)
committerTom Clegg <tom@curoverse.com>
Fri, 7 Mar 2014 16:26:52 +0000 (11:26 -0500)
sdk/cli/bin/arv-run-pipeline-instance

index fd29a6dab1b58f0879000866c363a477e6bad6db..dd89ad50b2b8471a2e9f23f76d5033d0f0f6183a 100755 (executable)
@@ -202,6 +202,22 @@ if $options[:run_here] == $options[:submit]
   abort "#{$0}: syntax error: you must supply either --run-here or --submit."
 end
 
+# Suppress SSL certificate checks if ARVADOS_API_HOST_INSECURE
+
+module Kernel
+  def suppress_warnings
+    original_verbosity = $VERBOSE
+    $VERBOSE = nil
+    result = yield
+    $VERBOSE = original_verbosity
+    return result
+  end
+end
+
+if ENV['ARVADOS_API_HOST_INSECURE']
+  suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE }
+end
+
 # Set up the API client.
 
 $client ||= Google::APIClient.