work around Excon problem with JRuby + SSL

This commit is contained in:
Mislav Marohnić 2012-08-16 11:55:51 +02:00
parent 79022619ac
commit 88c76087c8
4 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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] )

View File

@ -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

View File

@ -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