lib/apitool/client/apitool_client.rb in apitool-client-0.0.1 vs lib/apitool/client/apitool_client.rb in apitool-client-0.0.2
- old
+ new
@@ -5,10 +5,13 @@
@port ||= params[:port]
@ssl ||= params[:ssl] || false
@token ||= params[:token]
@version ||= params[:version] || 'v1'
@symbolize ||= params[:symbolize] || true
+
+ default_ssl_verification = (@ssl) ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
+ @verify_ssl ||= params[:verify_ssl] || default_ssl_verification
end
def response
@response.nil? ? nil : parse(@response)
end
@@ -23,10 +26,11 @@
protected
def get_connection
@client ||= RestClient::Resource.new(
- base_uri
+ base_uri,
+ verify_ssl: @verify_ssl
)
end
def get(path, options = {})
get_connection[request_uri(path)].get(headers) { |response, request, result, &block|