mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-29 00:03:58 -04:00
correct the logic correction: ssl[:verify_mode]
Previous logic correction (70f3eb3) was in fact a breakage of functionality. The ssl[:verify_mode] is not a boolean; it's the value that, if present, should be passed directly to http.verify_mode
This commit is contained in:
parent
a81b61a76f
commit
5dddbfb1fd
@ -16,8 +16,9 @@ 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.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.verify_mode = ssl[:verify_mode] || begin
|
||||
ssl.fetch(:verify, true) ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
||||
end
|
||||
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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user