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 +4 -4
- data/lib/httpclient/jruby_ssl_socket.rb +11 -4
- data/lib/httpclient/version.rb +1 -1
- data/test/test_ssl.rb +8 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec7e272df4e6600193bdd3a5fb96d7079884e9b1
|
4
|
+
data.tar.gz: 7582ada524a7bf3f92745af4f944187f302f22f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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'
|
data/lib/httpclient/version.rb
CHANGED
data/test/test_ssl.rb
CHANGED
@@ -217,18 +217,14 @@ else
|
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
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.
|
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-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: nahi@ruby-lang.org
|