logic correction...

This commit is contained in:
Todd Fisher 2011-08-07 18:11:30 -04:00
parent 3cb26e8d4f
commit 70f3eb3962

View File

@ -16,8 +16,8 @@ module Faraday
http = net_http_class(env).new(url.host, url.inferred_port)
if http.use_ssl = (url.scheme == 'https' && (ssl = env[:ssl]) && true)
http.verify_mode = ssl[:verify_mode] || ssl.fetch(:verify, true) ?
OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
http.verify_mode = ssl.key?(:verify_mode) ? (ssl[:verify_mode] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE) :
ssl.fetch(:verify, true) ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
http.cert = ssl[:client_cert] if ssl[:client_cert]
http.key = ssl[:client_key] if ssl[:client_key]
http.ca_file = ssl[:ca_file] if ssl[:ca_file]