summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2014-07-09 15:32:02 +0200
committerrautenberg <rautenberg@in-silico.ch>2014-07-09 15:32:02 +0200
commitd465c7792c2eb563c3e3403cb887f672c394b1e5 (patch)
tree91cea20ec4b1f51de884eac7921a21551685a00d /lib
parent83010d2019650512149cd511f0395023c77d483f (diff)
set default ssl verification to false to allow self signed certificates
Diffstat (limited to 'lib')
-rw-r--r--lib/rest-client-wrapper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb
index 732f46e..dc1def2 100644
--- a/lib/rest-client-wrapper.rb
+++ b/lib/rest-client-wrapper.rb
@@ -19,7 +19,7 @@ module OpenTox
# Does not wait for task to finish and returns task uri
# @param [String] destination URI
# @param [optional,Hash|String] Payload data posted to the service
- # @param [optional,Hash] Headers with params like :accept, :content_type, :subjectid
+ # @param [optional,Hash] Headers with params like :accept, :content_type, :subjectid, :verify_ssl
# @return [RestClient::Response] REST call response
[:head,:get,:post,:put,:delete].each do |method|
@@ -42,10 +42,11 @@ module OpenTox
args={}
args[:method] = method
args[:url] = uri
+ args[:verify_ssl] = 0 if headers[:verify_ssl].nil? || headers[:verify_ssl].empty?
args[:timeout] = 1800
args[:payload] = payload
headers.each{ |k,v| headers.delete(k) if v==nil } if headers #remove keys with empty values, as this can cause problems
- args[:headers] = headers
+ args[:headers] = headers
@request = RestClient::Request.new(args)
# ignore error codes from Task services (may return error codes >= 400 according to API, which causes exceptions in RestClient and RDF::Reader)