From a9062f7050f524a7594ead2577382ee1e86803d6 Mon Sep 17 00:00:00 2001 From: Andy Brody Date: Tue, 30 Jul 2013 16:12:53 -0700 Subject: [PATCH] Add support for specifying ssl_ca_path. --- lib/restclient/request.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/restclient/request.rb b/lib/restclient/request.rb index 1dd5267..56802b3 100644 --- a/lib/restclient/request.rb +++ b/lib/restclient/request.rb @@ -22,7 +22,7 @@ module RestClient # * :max_redirects maximum number of redirections (default to 10) # * :verify_ssl enable ssl verification, possible values are constants from OpenSSL::SSL # * :timeout and :open_timeout passing in -1 will disable the timeout by setting the corresponding net timeout values to nil - # * :ssl_client_cert, :ssl_client_key, :ssl_ca_file + # * :ssl_client_cert, :ssl_client_key, :ssl_ca_file, :ssl_ca_path # * :ssl_version specifies the SSL version for the underlying Net::HTTP connection (defaults to 'SSLv3') class Request @@ -30,7 +30,7 @@ module RestClient :payload, :user, :password, :timeout, :max_redirects, :open_timeout, :raw_response, :verify_ssl, :ssl_client_cert, :ssl_client_key, :ssl_ca_file, :processed_headers, :args, - :ssl_version + :ssl_version, :ssl_ca_path def self.execute(args, & block) new(args).execute(& block) @@ -56,6 +56,7 @@ module RestClient @ssl_client_cert = args[:ssl_client_cert] || nil @ssl_client_key = args[:ssl_client_key] || nil @ssl_ca_file = args[:ssl_ca_file] || nil + @ssl_ca_path = args[:ssl_ca_path] || nil @ssl_version = args[:ssl_version] || 'SSLv3' @tf = nil # If you are a raw request, this is your tempfile @max_redirects = args[:max_redirects] || 10 @@ -165,6 +166,7 @@ module RestClient net.cert = @ssl_client_cert if @ssl_client_cert net.key = @ssl_client_key if @ssl_client_key net.ca_file = @ssl_ca_file if @ssl_ca_file + net.ca_path = @ssl_ca_path if @ssl_ca_path net.read_timeout = @timeout if @timeout net.open_timeout = @open_timeout if @open_timeout