httpclient 2.8.2.1 → 2.8.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b5686de1cd51430fc814921d00eef9589abb460
4
- data.tar.gz: f4882d0555214f10727a0f0f43e76952167a5bc0
3
+ metadata.gz: 021f9c066d91d9a0bd923a76e8129bd11cefcda1
4
+ data.tar.gz: 937c6478b2fad5ad419cf2a840475490f094edbf
5
5
  SHA512:
6
- metadata.gz: 47c2d49d8395a7c2c3d5994f3d91315d787a6b18d7b6cb7b7f0b85144c41930092d7518a3be7df990db2918e6dc661d0422a7d0c699f413c58bd62dd9b8c3119
7
- data.tar.gz: e37781d77163754c473a2b0e73990c079788b3117ce11fed68d7761060f765bb51ddeca0c3acea4d45ddc9cf9ba5c37c5c443e589d3ccfefb36359c07a4c57b2
6
+ metadata.gz: 9fcc4b920feb54cbe8a1b0e6108f155cb219fbf7416fb0063168c65db9ec3c2210003c37f24399395ca81ea6627a410596d280174631fc7c53b7b1fc1563964b
7
+ data.tar.gz: f8d5ecf16b6aea4f12c1d7ed9e8cefb5ef797610996a73b1923d9142cc85d6580f599e539c77fa1aca194a1d6f2622f547a6a3ee6145a0c7f0fb047c6d9b42f9
@@ -39,27 +39,25 @@ class HTTPClient
39
39
  if SSLEnabled
40
40
  include OpenSSL
41
41
 
42
- if RUBY_ENGINE == 'jruby'
43
- module ::OpenSSL
44
- module X509
45
- class Store
46
- attr_reader :_httpclient_cert_store_items
47
-
48
- # TODO: use prepend instead when we drop JRuby + 1.9.x support
49
- wrapped = {}
50
-
51
- wrapped[:initialize] = instance_method(:initialize)
52
- define_method(:initialize) do |*args|
53
- wrapped[:initialize].bind(self).call(*args)
54
- @_httpclient_cert_store_items = [ENV['SSL_CERT_FILE'] || :default]
55
- end
42
+ module ::OpenSSL
43
+ module X509
44
+ class Store
45
+ attr_reader :_httpclient_cert_store_items
46
+
47
+ # TODO: use prepend instead when we drop JRuby + 1.9.x support
48
+ wrapped = {}
49
+
50
+ wrapped[:initialize] = instance_method(:initialize)
51
+ define_method(:initialize) do |*args|
52
+ wrapped[:initialize].bind(self).call(*args)
53
+ @_httpclient_cert_store_items = [ENV['SSL_CERT_FILE'] || :default]
54
+ end
56
55
 
57
- [:add_cert, :add_file, :add_path].each do |m|
58
- wrapped[m] = instance_method(m)
59
- define_method(m) do |cert|
60
- wrapped[m].bind(self).call(cert)
61
- @_httpclient_cert_store_items << cert
62
- end
56
+ [:add_cert, :add_file, :add_path].each do |m|
57
+ wrapped[m] = instance_method(m)
58
+ define_method(m) do |cert|
59
+ wrapped[m].bind(self).call(cert)
60
+ @_httpclient_cert_store_items << cert
63
61
  end
64
62
  end
65
63
  end
@@ -118,7 +116,7 @@ class HTTPClient
118
116
  attr_reader :client_ca # :nodoc:
119
117
 
120
118
  # These array keeps original files/dirs that was added to @cert_store
121
- def cert_store_items; @cert_store._httpclient_cert_store_items || []; end
119
+ def cert_store_items; @cert_store._httpclient_cert_store_items; end
122
120
  attr_reader :cert_store_crl_items
123
121
 
124
122
  # Creates a SSLConfig.
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '2.8.2.1'
2
+ VERSION = '2.8.2.2'
3
3
  end
@@ -175,6 +175,13 @@ end
175
175
  #
176
176
  cfg.cert_store.add_cert(cert('subca.cert'))
177
177
  assert_equal("hello", @client.get_content(@url))
178
+ cfg.clear_cert_store
179
+ begin
180
+ @client.get(@url)
181
+ assert(false)
182
+ rescue OpenSSL::SSL::SSLError => ssle
183
+ assert_match(/(certificate verify failed|unable to find valid certification path to requested target)/, ssle.message)
184
+ end
178
185
  end
179
186
 
180
187
  if defined?(HTTPClient::JRubySSLSocket)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.2.1
4
+ version: 2.8.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Nakamura