mirror of
https://github.com/lostisland/faraday.git
synced 2025-12-06 00:01:23 -05:00
work around Excon problem with JRuby + SSL
This commit is contained in:
parent
79022619ac
commit
88c76087c8
2
Gemfile
2
Gemfile
@ -7,7 +7,7 @@ end
|
||||
group :test do
|
||||
gem 'em-http-request', '~> 1.0', :require => 'em-http'
|
||||
gem 'em-synchrony', '~> 1.0', :require => ['em-synchrony', 'em-synchrony/em-http'], :platforms => :ruby_19
|
||||
gem 'excon', '>= 0.14.1'
|
||||
gem 'excon', '>= 0.16.1'
|
||||
gem 'httpclient', '~> 2.2'
|
||||
gem 'net-http-persistent', '~> 2.5', :require => false
|
||||
gem 'leftright', '~> 0.9', :require => false
|
||||
|
||||
@ -16,6 +16,10 @@ module Faraday
|
||||
opts[:ssl_verify_peer] = !!ssl.fetch(:verify, true)
|
||||
opts[:ssl_ca_path] = ssl[:ca_path] if ssl[:ca_path]
|
||||
opts[:ssl_ca_file] = ssl[:ca_file] if ssl[:ca_file]
|
||||
|
||||
# https://github.com/geemus/excon/issues/106
|
||||
# https://github.com/jruby/jruby-ossl/issues/19
|
||||
opts[:nonblock] = false
|
||||
end
|
||||
|
||||
if ( req = env[:request] )
|
||||
|
||||
@ -5,6 +5,9 @@ module Adapters
|
||||
|
||||
def adapter() :excon end
|
||||
|
||||
Integration.apply(self, :NonParallel)
|
||||
Integration.apply(self, :NonParallel) do
|
||||
# https://github.com/geemus/excon/issues/126 ?
|
||||
undef :test_timeout if ssl_mode?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -74,6 +74,10 @@ module Faraday
|
||||
defined? RUBY_ENGINE and 'jruby' == RUBY_ENGINE
|
||||
end
|
||||
|
||||
def self.rbx?
|
||||
defined? RUBY_ENGINE and 'rbx' == RUBY_ENGINE
|
||||
end
|
||||
|
||||
def self.ssl_mode?
|
||||
ENV['SSL'] == 'yes'
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user