Permalink
Browse files

work around Excon problem with JRuby + SSL

  • Loading branch information...
1 parent 7902261 commit 88c76087c895f58dac74ae0a9235ef89a07320f7 @mislav mislav committed Aug 16, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −1 Gemfile
  2. +4 −0 lib/faraday/adapter/excon.rb
  3. +4 −1 test/adapters/excon_test.rb
  4. +4 −0 test/helper.rb
View
@@ -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 @@ def call(env)
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 @@ class ExconTest < Faraday::TestCase
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
@@ -74,6 +74,10 @@ def self.jruby?
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

0 comments on commit 88c7608

Please sign in to comment.