httpclient 2.8.1 → 2.8.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: c4ffce5e3ce378196b7441498f0a93969da6086f
4
- data.tar.gz: 91ba9e1062f6515828ae1983ca28eb0a2d40a75d
3
+ metadata.gz: ec7e272df4e6600193bdd3a5fb96d7079884e9b1
4
+ data.tar.gz: 7582ada524a7bf3f92745af4f944187f302f22f9
5
5
  SHA512:
6
- metadata.gz: 743acf9501f271b66d4b7dcc25812ea766f81d4e3eae6f5a4784ce157a3db7f81a386c6d8a7cced0b87cb464040752997047dad0d627cc94fb9451371f34a44b
7
- data.tar.gz: 1e14c7fdd6ec23d895310ca70f3a96a6bd44910371f6221c33095fa4302344da15574a109e800493481e8477dbbb33ce4c4d2cb0661e271c0846d3b8674cf8ba
6
+ metadata.gz: 42e6d5bdb00c17c46eedb6d73277d6e2197ac61a010c50efbb48cee2c5a502127c65863cee60b5450a17a063434cbde70de926d435cd978c2b5c542acec17fe7
7
+ data.tar.gz: 6e2cc8eda6e3ad3d53d2c7a2ccb554a1a82de12b88404d9d61e51e9a1f1f2057868100e98302cbfd589c732a96b13c33a03563064ba3dff7b4ba4b76114d73dd
@@ -316,6 +316,7 @@ unless defined?(SSLSocket)
316
316
  return if cert_source == :default
317
317
  if cert_source.respond_to?(:to_pem)
318
318
  pem = cert_source.to_pem
319
+ load_pem(pem)
319
320
  elsif File.directory?(cert_source)
320
321
  warn("#{cert_source}: directory not yet supported")
321
322
  return
@@ -326,7 +327,8 @@ unless defined?(SSLSocket)
326
327
  when /-----BEGIN CERTIFICATE-----/
327
328
  pem = ''
328
329
  when /-----END CERTIFICATE-----/
329
- break
330
+ load_pem(pem)
331
+ # keep parsing in case where multiple certificates in a file
330
332
  else
331
333
  if pem
332
334
  pem << line
@@ -334,9 +336,6 @@ unless defined?(SSLSocket)
334
336
  end
335
337
  end
336
338
  end
337
- cert = PEMUtils.read_certificate(pem)
338
- @size += 1
339
- @trust_store.setCertificateEntry("cert_#{@size}", cert)
340
339
  end
341
340
 
342
341
  def trust_store
@@ -346,6 +345,14 @@ unless defined?(SSLSocket)
346
345
  @trust_store
347
346
  end
348
347
  end
348
+
349
+ private
350
+
351
+ def load_pem(pem)
352
+ cert = PEMUtils.read_certificate(pem)
353
+ @size += 1
354
+ @trust_store.setCertificateEntry("cert_#{@size}", cert)
355
+ end
349
356
  end
350
357
 
351
358
  # Ported from commons-httpclient 'BrowserCompatHostnameVerifier'
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '2.8.1'
2
+ VERSION = '2.8.2'
3
3
  end
@@ -217,18 +217,14 @@ else
217
217
  end
218
218
  end
219
219
 
220
- # SSL_CERT_FILE does not work with recent jruby-openssl.
221
- # You should not depend on SSL_CERT_FILE on JRuby
222
- if !defined?(JRUBY_VERSION)
223
- def test_set_default_paths
224
- assert_raise(OpenSSL::SSL::SSLError) do
225
- @client.get(@url)
226
- end
227
- escape_env do
228
- ENV['SSL_CERT_FILE'] = File.join(DIR, 'ca-chain.pem')
229
- @client.ssl_config.set_default_paths
230
- @client.get(@url)
231
- end
220
+ def test_set_default_paths
221
+ assert_raise(OpenSSL::SSL::SSLError) do
222
+ @client.get(@url)
223
+ end
224
+ escape_env do
225
+ ENV['SSL_CERT_FILE'] = File.join(DIR, 'ca-chain.pem')
226
+ @client.ssl_config.set_default_paths
227
+ @client.get(@url)
232
228
  end
233
229
  end
234
230
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-07 00:00:00.000000000 Z
11
+ date: 2016-08-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: nahi@ruby-lang.org