httpi 2.4.5 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/development.yml +48 -0
- data/CHANGELOG.md +6 -1
- data/Gemfile +8 -6
- data/README.md +1 -6
- data/httpi.gemspec +5 -4
- data/lib/httpi/adapter/curb.rb +1 -0
- data/lib/httpi/adapter/excon.rb +1 -0
- data/lib/httpi/adapter/http.rb +1 -0
- data/lib/httpi/adapter/httpclient.rb +1 -0
- data/lib/httpi/adapter/net_http.rb +1 -0
- data/lib/httpi/adapter/net_http_persistent.rb +1 -6
- data/lib/httpi/auth/ssl.rb +19 -1
- data/lib/httpi/version.rb +1 -1
- data/spec/fixtures/client_cert.pem +18 -14
- data/spec/fixtures/client_key.pem +25 -13
- data/spec/httpi/adapter/curb_spec.rb +7 -0
- data/spec/httpi/adapter/em_http_spec.rb +2 -8
- data/spec/httpi/adapter/httpclient_spec.rb +7 -0
- data/spec/httpi/auth/ssl_spec.rb +17 -0
- data/spec/httpi/httpi_spec.rb +2 -4
- data/spec/integration/curb_spec.rb +9 -0
- data/spec/integration/em_http_spec.rb +2 -2
- data/spec/integration/excon_spec.rb +10 -1
- data/spec/integration/fixtures/ca_all.pem +17 -42
- data/spec/integration/fixtures/server.cert +17 -17
- data/spec/integration/fixtures/server.key +25 -13
- data/spec/integration/http_spec.rb +9 -0
- data/spec/integration/httpclient_spec.rb +9 -0
- data/spec/integration/net_http_persistent_spec.rb +13 -2
- data/spec/integration/net_http_spec.rb +9 -0
- data/spec/integration/support/server.rb +1 -2
- data/spec/spec_helper.rb +0 -2
- metadata +14 -14
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c921690b77440f26fa4da9bac58ed74d16440e9df7d180be606e1c21460dfbb
|
4
|
+
data.tar.gz: d95e355e1925d7cb78622fc6188cc761eedec15e30ad9bd93b565937873d86c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09c5e6e4bf5242de2f9472123c94ca3f17a3fd60e816886cf7402d4d977d45e2cc8be98e3d6a4ac2c7d16b68af8cef58a016d4b1b4aa443bfca92bde6f7232ce'
|
7
|
+
data.tar.gz: ba7d999bc0d771365a4c647df38419f7ba2ee22f3d06c33dd660645aad999d7529d1ce8036b9d2d24994098fcdf2f415df2b533b4c68c5c1a483b0e25862629a
|
@@ -0,0 +1,48 @@
|
|
1
|
+
name: Development
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
name: ${{matrix.ruby}} on ${{matrix.os}}
|
8
|
+
runs-on: ${{matrix.os}}-latest
|
9
|
+
continue-on-error: ${{matrix.experimental}}
|
10
|
+
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
os:
|
14
|
+
- ubuntu
|
15
|
+
|
16
|
+
ruby:
|
17
|
+
- "2.6"
|
18
|
+
- "2.7"
|
19
|
+
- "3.0"
|
20
|
+
|
21
|
+
experimental: [false]
|
22
|
+
env: [""]
|
23
|
+
|
24
|
+
include:
|
25
|
+
- os: ubuntu
|
26
|
+
ruby: truffleruby
|
27
|
+
experimental: true
|
28
|
+
- os: ubuntu
|
29
|
+
ruby: jruby
|
30
|
+
experimental: true
|
31
|
+
- os: ubuntu
|
32
|
+
ruby: head
|
33
|
+
experimental: true
|
34
|
+
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v2
|
37
|
+
|
38
|
+
- name: Install dependencies
|
39
|
+
run: sudo apt-get install libcurl4-openssl-dev
|
40
|
+
|
41
|
+
- uses: ruby/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
ruby-version: ${{matrix.ruby}}
|
44
|
+
bundler-cache: true
|
45
|
+
|
46
|
+
- name: Run tests
|
47
|
+
timeout-minutes: 5
|
48
|
+
run: ${{matrix.env}} bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
### 2.5.0 (2021-10-05)
|
2
|
+
|
3
|
+
* Feature: [#214](https://github.com/savonrb/httpi/pull/214) Add SSL ciphers configuration
|
4
|
+
* Improvement: [#227](https://github.com/savonrb/httpi/pull/227) Use GitHub Actions as CI. Require at least Ruby v2.3.
|
5
|
+
|
1
6
|
### 2.4.5
|
2
7
|
|
3
8
|
* Improvement: [#209](https://github.com/savonrb/httpi/pull/209) Drop Travis CI support for Ruby < 2.3.0 and jruby.
|
4
|
-
*
|
9
|
+
* Feature: [#208](https://github.com/savonrb/httpi/pull/208) Add SSL min/max_version configuration for supporting adapters
|
5
10
|
* Improvement: [#206](https://github.com/savonrb/httpi/pull/206) Support for net-http-persistent v3
|
6
11
|
* Improvement: [#204](https://github.com/savonrb/httpi/pull/204) Avoid excon warning
|
7
12
|
|
data/Gemfile
CHANGED
@@ -3,18 +3,20 @@ gemspec
|
|
3
3
|
|
4
4
|
gem 'jruby-openssl', :platforms => :jruby
|
5
5
|
|
6
|
-
|
7
|
-
gem 'public_suffix', '~> 2.0' # or remove rubies < 2.1 from travis.yml
|
6
|
+
gem 'public_suffix', '~> 4.0'
|
8
7
|
|
9
8
|
# http clients
|
10
9
|
gem 'httpclient', '~> 2.3', :require => false
|
11
|
-
gem 'curb', '~> 0.8', :require => false, :platforms => :ruby
|
12
|
-
gem 'em-http-request', :require => false, :platforms => [:ruby
|
10
|
+
gem 'curb', '~> 0.8', :require => false, :platforms => [:ruby]
|
11
|
+
gem 'em-http-request', :require => false, :platforms => [:ruby]
|
13
12
|
gem 'em-synchrony', :require => false, :platforms => [:ruby, :jruby]
|
14
13
|
gem 'excon', '~> 0.21', :require => false, :platforms => [:ruby, :jruby]
|
15
|
-
gem 'net-http-persistent', '~>
|
14
|
+
gem 'net-http-persistent', '~> 4.0', :require => false
|
16
15
|
gem 'http', :require => false
|
17
16
|
|
17
|
+
# adapter extensions
|
18
|
+
gem 'rack'
|
19
|
+
gem 'socksify'
|
20
|
+
|
18
21
|
# coverage
|
19
22
|
gem 'simplecov', :require => false
|
20
|
-
gem 'coveralls', :require => false
|
data/README.md
CHANGED
@@ -5,11 +5,7 @@ A common interface for Ruby's HTTP libraries.
|
|
5
5
|
[Documentation](https://www.rubydoc.info/gems/httpi) |
|
6
6
|
[Mailing list](https://groups.google.com/forum/#!forum/httpirb)
|
7
7
|
|
8
|
-
[![
|
9
|
-
[![Gem Version](https://badge.fury.io/rb/httpi.svg)](http://badge.fury.io/rb/httpi)
|
10
|
-
[![Code Climate](https://codeclimate.com/github/savonrb/httpi.svg)](https://codeclimate.com/github/savonrb/httpi)
|
11
|
-
[![Coverage Status](https://coveralls.io/repos/savonrb/httpi/badge.svg?branch=master)](https://coveralls.io/r/savonrb/httpi)
|
12
|
-
|
8
|
+
[![Development](https://github.com/savonrb/httpi/actions/workflows/development.yml/badge.svg)](https://github.com/savonrb/httpi/actions/workflows/development.yml)
|
13
9
|
|
14
10
|
## Installation
|
15
11
|
|
@@ -28,7 +24,6 @@ gem 'httpi', '~> 2.1.0'
|
|
28
24
|
|
29
25
|
## Usage example
|
30
26
|
|
31
|
-
|
32
27
|
``` ruby
|
33
28
|
require "httpi"
|
34
29
|
|
data/httpi.gemspec
CHANGED
@@ -11,7 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "http://github.com/savonrb/#{s.name}"
|
12
12
|
s.summary = "Common interface for Ruby's HTTP libraries"
|
13
13
|
s.description = s.summary
|
14
|
-
|
14
|
+
|
15
|
+
s.required_ruby_version = '>= 2.3'
|
15
16
|
|
16
17
|
s.license = 'MIT'
|
17
18
|
|
@@ -19,10 +20,10 @@ Gem::Specification.new do |s|
|
|
19
20
|
s.add_dependency 'socksify'
|
20
21
|
|
21
22
|
s.add_development_dependency 'rubyntlm', '~> 0.3.2'
|
22
|
-
s.add_development_dependency 'rake', '~>
|
23
|
-
s.add_development_dependency 'rspec', '~>
|
23
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.5'
|
24
25
|
s.add_development_dependency 'mocha', '~> 0.13'
|
25
|
-
s.add_development_dependency 'puma', '~>
|
26
|
+
s.add_development_dependency 'puma', '~> 5.0'
|
26
27
|
s.add_development_dependency 'webmock'
|
27
28
|
|
28
29
|
s.files = `git ls-files`.split("\n")
|
data/lib/httpi/adapter/curb.rb
CHANGED
@@ -116,6 +116,7 @@ module HTTPI
|
|
116
116
|
@client.cert_key = ssl.cert_key_file
|
117
117
|
@client.cert = ssl.cert_file
|
118
118
|
@client.certpassword = ssl.cert_key_password
|
119
|
+
@client.set(:ssl_cipher_list, ssl.ciphers.join(':')) if ssl.ciphers
|
119
120
|
|
120
121
|
@client.ssl_verify_peer = ssl.verify_mode == :peer
|
121
122
|
end
|
data/lib/httpi/adapter/excon.rb
CHANGED
@@ -73,6 +73,7 @@ module HTTPI
|
|
73
73
|
opts[:ssl_verify_peer] = false
|
74
74
|
end
|
75
75
|
|
76
|
+
opts[:ciphers] = ssl.ciphers if ssl.ciphers
|
76
77
|
opts[:ssl_version] = ssl.ssl_version if ssl.ssl_version
|
77
78
|
opts[:ssl_min_version] = ssl.min_version if ssl.min_version
|
78
79
|
opts[:ssl_max_version] = ssl.max_version if ssl.max_version
|
data/lib/httpi/adapter/http.rb
CHANGED
@@ -61,6 +61,7 @@ module HTTPI
|
|
61
61
|
context.min_version = @request.auth.ssl.min_version if @request.auth.ssl.min_version != nil
|
62
62
|
context.max_version = @request.auth.ssl.max_version if @request.auth.ssl.max_version != nil
|
63
63
|
context.verify_mode = @request.auth.ssl.openssl_verify_mode
|
64
|
+
context.ciphers = @request.auth.ssl.ciphers if @request.auth.ssl.ciphers
|
64
65
|
|
65
66
|
client = ::HTTP::Client.new(:ssl_context => context)
|
66
67
|
else
|
@@ -73,6 +73,7 @@ module HTTPI
|
|
73
73
|
# Send client-side certificate regardless of state of SSL verify mode
|
74
74
|
@client.ssl_config.client_cert = ssl.cert
|
75
75
|
@client.ssl_config.client_key = ssl.cert_key
|
76
|
+
@client.ssl_config.ciphers = ssl.ciphers if ssl.ciphers
|
76
77
|
|
77
78
|
@client.ssl_config.verify_mode = ssl.openssl_verify_mode
|
78
79
|
end
|
@@ -177,6 +177,7 @@ module HTTPI
|
|
177
177
|
# Send client-side certificate regardless of state of SSL verify mode
|
178
178
|
@client.key = ssl.cert_key
|
179
179
|
@client.cert = ssl.cert
|
180
|
+
@client.ciphers = ssl.ciphers if ssl.ciphers
|
180
181
|
|
181
182
|
@client.verify_mode = ssl.openssl_verify_mode
|
182
183
|
end
|
@@ -12,7 +12,7 @@ module HTTPI
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def create_client
|
15
|
-
if
|
15
|
+
if Gem::Version.new(Net::HTTP::Persistent::VERSION) >= Gem::Version.new('3.0.0')
|
16
16
|
Net::HTTP::Persistent.new name: thread_key
|
17
17
|
else
|
18
18
|
Net::HTTP::Persistent.new thread_key
|
@@ -42,11 +42,6 @@ module HTTPI
|
|
42
42
|
def thread_key
|
43
43
|
@request.url.host.split(/\W/).reject{|p|p == ""}.join('-')
|
44
44
|
end
|
45
|
-
|
46
|
-
def is_v3
|
47
|
-
Net::HTTP::Persistent::VERSION.start_with? "3."
|
48
|
-
end
|
49
|
-
|
50
45
|
end
|
51
46
|
end
|
52
47
|
end
|
data/lib/httpi/auth/ssl.rb
CHANGED
@@ -25,7 +25,7 @@ module HTTPI
|
|
25
25
|
|
26
26
|
# Returns whether SSL configuration is present.
|
27
27
|
def present?
|
28
|
-
(verify_mode == :none) || (cert && cert_key) || ca_cert_file
|
28
|
+
(verify_mode == :none) || (cert && cert_key) || ca_cert_file || ciphers
|
29
29
|
rescue TypeError, Errno::ENOENT
|
30
30
|
false
|
31
31
|
end
|
@@ -48,6 +48,24 @@ module HTTPI
|
|
48
48
|
# Certificate store holds trusted CA certificates used to verify peer certificates.
|
49
49
|
attr_accessor :cert_store
|
50
50
|
|
51
|
+
# Accessor for the SSL ciphers list.
|
52
|
+
attr_reader :ciphers
|
53
|
+
|
54
|
+
# Sets the available symmetric algorithms for encryption and decryption.
|
55
|
+
# @see OpenSSL::SSL::SSLContext#ciphers
|
56
|
+
# @example
|
57
|
+
# ssl.ciphers = "cipher1:cipher2:..."
|
58
|
+
# ssl.ciphers = [name, ...]
|
59
|
+
# ssl.ciphers = [[name, version, bits, alg_bits], ...]
|
60
|
+
def ciphers=(ciphers)
|
61
|
+
@ciphers =
|
62
|
+
if ciphers
|
63
|
+
context = OpenSSL::SSL::SSLContext.new
|
64
|
+
context.ciphers = ciphers
|
65
|
+
context.ciphers.map(&:first)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
51
69
|
# Returns the cert type to validate SSL certificates PEM|DER.
|
52
70
|
def cert_type
|
53
71
|
@cert_type ||= :pem
|
data/lib/httpi/version.rb
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
2
|
+
MIIDVTCCAj2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQKDBhEZXZl
|
3
|
+
bG9wbWVudC9DTj1sb2NhbGhvc3QwHhcNMTgwODEwMDAzMTQzWhcNMjgwODA3MDAz
|
4
|
+
MTQzWjAjMSEwHwYDVQQKDBhEZXZlbG9wbWVudC9DTj1sb2NhbGhvc3QwggEiMA0G
|
5
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbU3vifU9omTx5T6ECuYnvryr4iWPP
|
6
|
+
A4sXhduO8aD3IdA8zHlPtZnmh0liE30nAY00xKa4Eisxs9/UgUoHlEb5nCtYs6Od
|
7
|
+
9pjiuyry2G5lBHIhLlVNTbReRKfjhr3ewUxcnQN0xiynjfsUMbzoVI1ZsGDW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QEwt54Nw3dQ
|
17
|
+
IvFzq/f0XVhkw4Coo38WZ4nTctbW/ZkVvKJnk2DJE1ubNJvw1wHzwz848BVT/b4Z
|
18
|
+
VplqNDPvWmEmGFzrLeOwPZfDcglDxaCpjF7q0GqTAoGAcEOjUHJuxjvqpceR4NVL
|
19
|
+
vwfqXhRecWMlXJZiaqhzFrfkB4m9D98+/3I/bdesRXrWaNAbgv+GfpmB8X65SHzT
|
20
|
+
zht9hEvn6A1LdX0KfIDKzeMCc49qY49N6ZgQNVnsW7DiZLAyMVbz5Hc1oNhHnWXg
|
21
|
+
lHQfbUsbfeQjh2Q6YVMpZxkCgYAmC2pGJciup46CjIrraAsKqJJsbbC8XETsvXNf
|
22
|
+
RTisYaQWC4DH1lDxQ7LpNhOjWL46Oqh+KlK+HJ956PJlltI0s7UDdOQkWrj4YpC7
|
23
|
+
xAT/DuY0T9YPuc7gPr+O1qIlj3ZH1smMxh6SChzfYJZ3BcsZ7CWCPWvZbQOmjHg2
|
24
|
+
cagKDQKBgQCjuICU3aElEXyGwPCEazVakgcuAuiAAjECQrHrbSVPaTDu6Cumupkw
|
25
|
+
50ypk/qJ3DegEumpufwLg37A9yFogkkHBI9Sw0PVjzXM0iWJsHceLTHWUgJBWcl3
|
26
|
+
5Sl/AacXbUHz4NMqARNVrfR3DP33Z/YXJ4bpsVswEjD51jPwwluwyA==
|
15
27
|
-----END RSA PRIVATE KEY-----
|
@@ -250,6 +250,13 @@ unless RUBY_PLATFORM =~ /java/
|
|
250
250
|
request
|
251
251
|
end
|
252
252
|
|
253
|
+
it 'sets ssl_cipher_list' do
|
254
|
+
request.auth.ssl.ciphers = ["AES128"]
|
255
|
+
curb.expects(:set).with(any_parameters).at_least(1)
|
256
|
+
curb.expects(:set).with(:ssl_cipher_list, anything)
|
257
|
+
adapter.request(:get)
|
258
|
+
end
|
259
|
+
|
253
260
|
context 'sets ssl_version' do
|
254
261
|
it 'defaults to nil when no ssl_version is specified' do
|
255
262
|
curb.expects(:ssl_version=).with(nil)
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
require "httpi/adapter/em_http"
|
3
3
|
require "httpi/request"
|
4
4
|
|
5
|
-
|
5
|
+
unless RUBY_PLATFORM =~ /java/
|
6
6
|
HTTPI::Adapter.load_adapter(:em_http)
|
7
7
|
|
8
8
|
describe HTTPI::Adapter::EmHttpRequest do
|
@@ -150,7 +150,7 @@ begin
|
|
150
150
|
|
151
151
|
it "raises an error for HTTP digest auth" do
|
152
152
|
request.auth.digest "username", "password"
|
153
|
-
expect { adapter.request(:get) }.to raise_error
|
153
|
+
expect { adapter.request(:get) }.to raise_error HTTPI::NotSupportedError
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
@@ -177,10 +177,4 @@ begin
|
|
177
177
|
end
|
178
178
|
|
179
179
|
end
|
180
|
-
rescue LoadError => e
|
181
|
-
if e.message =~ /fiber/
|
182
|
-
warn "LoadError: #{e.message} (EventMachine requires fibers)"
|
183
|
-
else
|
184
|
-
raise e
|
185
|
-
end
|
186
180
|
end
|
@@ -141,6 +141,13 @@ describe HTTPI::Adapter::HTTPClient do
|
|
141
141
|
|
142
142
|
adapter.request(:get)
|
143
143
|
end
|
144
|
+
|
145
|
+
it 'should set the ciphers if specified' do
|
146
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
147
|
+
ssl_config.expects(:ciphers=).with(request.auth.ssl.ciphers)
|
148
|
+
|
149
|
+
adapter.request(:get)
|
150
|
+
end
|
144
151
|
end
|
145
152
|
|
146
153
|
context "(for SSL client auth)" do
|
data/spec/httpi/auth/ssl_spec.rb
CHANGED
@@ -189,6 +189,23 @@ describe HTTPI::Auth::SSL do
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
+
describe '#ciphers' do
|
193
|
+
subject { ssl.ciphers }
|
194
|
+
let(:ssl) { HTTPI::Auth::SSL.new }
|
195
|
+
|
196
|
+
context 'without ciphers' do
|
197
|
+
before { ssl.ciphers = nil }
|
198
|
+
|
199
|
+
it { is_expected.to eq(nil) }
|
200
|
+
end
|
201
|
+
|
202
|
+
context 'with ciphers' do
|
203
|
+
before { ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers }
|
204
|
+
|
205
|
+
it { is_expected.to be_any.and(all(be_an_instance_of(String))) }
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
192
209
|
def ssl
|
193
210
|
ssl = HTTPI::Auth::SSL.new
|
194
211
|
ssl.cert_key_file = "spec/fixtures/client_key.pem"
|
data/spec/httpi/httpi_spec.rb
CHANGED
@@ -6,11 +6,9 @@ require "excon"
|
|
6
6
|
require "net/http/persistent"
|
7
7
|
require "http"
|
8
8
|
|
9
|
-
unless
|
9
|
+
unless RUBY_PLATFORM =~ /java/
|
10
10
|
require "em-synchrony"
|
11
11
|
require "em-http-request"
|
12
|
-
end
|
13
|
-
unless RUBY_PLATFORM =~ /java/
|
14
12
|
require "curb"
|
15
13
|
end
|
16
14
|
|
@@ -294,7 +292,7 @@ describe HTTPI do
|
|
294
292
|
end
|
295
293
|
|
296
294
|
HTTPI::Adapter::ADAPTERS.each do |adapter, opts|
|
297
|
-
unless (adapter == :em_http
|
295
|
+
unless (adapter == :em_http || adapter == :curb) && RUBY_PLATFORM =~ /java/
|
298
296
|
client_class = {
|
299
297
|
:httpclient => lambda { HTTPClient },
|
300
298
|
:curb => lambda { Curl::Easy },
|
@@ -123,6 +123,15 @@ describe HTTPI::Adapter::Curb do
|
|
123
123
|
response = HTTPI.get(request, adapter)
|
124
124
|
expect(response.body).to eq("get")
|
125
125
|
end
|
126
|
+
|
127
|
+
it "works with ciphers" do
|
128
|
+
request = HTTPI::Request.new(@server.url)
|
129
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
130
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
131
|
+
|
132
|
+
response = HTTPI.get(request, adapter)
|
133
|
+
expect(response.body).to eq("get")
|
134
|
+
end
|
126
135
|
end
|
127
136
|
|
128
137
|
end
|
@@ -3,8 +3,8 @@ require "integration/support/server"
|
|
3
3
|
|
4
4
|
describe HTTPI::Adapter::EmHttpRequest do
|
5
5
|
|
6
|
-
# em_http is not supported on
|
7
|
-
unless
|
6
|
+
# em_http is not supported on java
|
7
|
+
unless RUBY_PLATFORM =~ /java/
|
8
8
|
require "em-synchrony"
|
9
9
|
|
10
10
|
subject(:adapter) { :em_http }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "integration/support/server"
|
3
3
|
|
4
|
-
describe HTTPI::Adapter::
|
4
|
+
describe HTTPI::Adapter::Excon do
|
5
5
|
|
6
6
|
subject(:adapter) { :excon }
|
7
7
|
|
@@ -159,6 +159,15 @@ describe HTTPI::Adapter::HTTPClient do
|
|
159
159
|
response = HTTPI.get(request, adapter)
|
160
160
|
expect(response.body).to eq("get")
|
161
161
|
end
|
162
|
+
|
163
|
+
it "works with ciphers" do
|
164
|
+
request = HTTPI::Request.new(@server.url)
|
165
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
166
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
167
|
+
|
168
|
+
response = HTTPI.get(request, adapter)
|
169
|
+
expect(response.body).to eq("get")
|
170
|
+
end
|
162
171
|
end
|
163
172
|
end
|
164
173
|
|
@@ -1,44 +1,19 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
MJJFRkSu6d/Ph5ypzBVw2YMT/nsOo5VwMUGLgS7YVjU+u/HNWz80J3oO17mNZllj
|
20
|
-
PvORJcnjwlroDnS58KoJ7GDgejv3ESWADvX1OHLE4cRkiQGeLoEU4pxdCxX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BANIW
|
16
|
+
kJRF2Pl4yWc7MRjF+WnGfhJHv7VOcLlmFD1fa/IIM9xuBRgikiBWHtFwLoXknsY8
|
17
|
+
y2VqNrPEkjCp+qLpXLC8l3dzpNU33Z42h/tUfoTmgSgDUQXGggjzbcS8cf+1D55z
|
18
|
+
KuPazKAndyiuhIENk1gE+5RKdNyjYP2sI4+L5jexAoGBANxx2rw9GywHj9n/P006
|
19
|
+
pnO2Ol49nGsYiWp5E3bwZtIl+shf6GLgeRpWhj3TBnMhIlWnB/kpiiq8i0Tw7URo
|
20
|
+
9H+9IqRcNqTbX2ebeXjOCc+5DkLp4LQq83OmRsM1R+HTTtC4ipb9cucqpA1HOftp
|
21
|
+
z5isGq3ctdXaxP8YsLuPcw1RAoGAXZx0W70ryy2JAJidbd55Hiq17ktOHumOzO2x
|
22
|
+
Qw+Lt9Lz2NqlJnXxCruVC9miwUJ3hPl93/iN21hRk6GJ7qFxDcda7nz3C5LTCzZd
|
23
|
+
LR4fKfTTxBKGPb6QHpDpbmpRmZECHqZOjCzoVMyBCf2JST/VUbkWqKLso4uhIidb
|
24
|
+
yRCbSmECgYEAp+IuwpnMxVPxP52/xPFVcAxH2pDfmn5TJLJCNuKEUAS9ncZuz7rh
|
25
|
+
jJxtbC4AoGsS0+TdxnlMBvBpZE3QddQmjvey77yu/OvRUX2m/J/d+I2duTaHGR9Z
|
26
|
+
9VMxtlFY+DbDkJI2HVVxu5XfLKMJSEsMza8K64Ntx3XY3dJLCHrR1EY=
|
15
27
|
-----END RSA PRIVATE KEY-----
|
@@ -141,6 +141,15 @@ describe HTTPI::Adapter::HTTP do
|
|
141
141
|
response = HTTPI.get(request, adapter)
|
142
142
|
expect(response.body).to eq("get")
|
143
143
|
end
|
144
|
+
|
145
|
+
it "works with ciphers" do
|
146
|
+
request = HTTPI::Request.new(@server.url)
|
147
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
148
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
149
|
+
|
150
|
+
response = HTTPI.get(request, adapter)
|
151
|
+
expect(response.body).to eq("get")
|
152
|
+
end
|
144
153
|
end
|
145
154
|
end
|
146
155
|
|
@@ -121,6 +121,15 @@ describe HTTPI::Adapter::HTTPClient do
|
|
121
121
|
response = HTTPI.get(request, adapter)
|
122
122
|
expect(response.body).to eq("get")
|
123
123
|
end
|
124
|
+
|
125
|
+
it "works with ciphers" do
|
126
|
+
request = HTTPI::Request.new(@server.url)
|
127
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
128
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
129
|
+
|
130
|
+
response = HTTPI.get(request, adapter)
|
131
|
+
expect(response.body).to eq("get")
|
132
|
+
end
|
124
133
|
end
|
125
134
|
end
|
126
135
|
|
@@ -1,7 +1,8 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "integration/support/server"
|
3
|
+
require "net/http/persistent"
|
3
4
|
|
4
|
-
describe HTTPI::Adapter::
|
5
|
+
describe HTTPI::Adapter::NetHTTPPersistent do
|
5
6
|
|
6
7
|
subject(:adapter) { :net_http_persistent }
|
7
8
|
|
@@ -38,7 +39,7 @@ describe HTTPI::Adapter::NetHTTP do
|
|
38
39
|
|
39
40
|
expect do
|
40
41
|
HTTPI.get(request, adapter)
|
41
|
-
end.to raise_exception(Net::
|
42
|
+
end.to raise_exception(Net::ReadTimeout)
|
42
43
|
end
|
43
44
|
|
44
45
|
it "executes GET requests" do
|
@@ -110,6 +111,7 @@ describe HTTPI::Adapter::NetHTTP do
|
|
110
111
|
before :all do
|
111
112
|
@server = IntegrationServer.run(:ssl => true)
|
112
113
|
end
|
114
|
+
|
113
115
|
after :all do
|
114
116
|
@server.stop
|
115
117
|
end
|
@@ -122,6 +124,15 @@ describe HTTPI::Adapter::NetHTTP do
|
|
122
124
|
response = HTTPI.get(request, adapter)
|
123
125
|
expect(response.body).to eq("get")
|
124
126
|
end
|
127
|
+
|
128
|
+
it "works with ciphers" do
|
129
|
+
request = HTTPI::Request.new(@server.url)
|
130
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
131
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
132
|
+
|
133
|
+
response = HTTPI.get(request, adapter)
|
134
|
+
expect(response.body).to eq("get")
|
135
|
+
end
|
125
136
|
end
|
126
137
|
end
|
127
138
|
|
@@ -227,6 +227,15 @@ describe HTTPI::Adapter::NetHTTP do
|
|
227
227
|
response = HTTPI.get(request, adapter)
|
228
228
|
expect(response.body).to eq("get")
|
229
229
|
end
|
230
|
+
|
231
|
+
it "works with ciphers" do
|
232
|
+
request = HTTPI::Request.new(@server.url)
|
233
|
+
request.auth.ssl.ca_cert_file = IntegrationServer.ssl_ca_file
|
234
|
+
request.auth.ssl.ciphers = OpenSSL::SSL::SSLContext.new.ciphers
|
235
|
+
|
236
|
+
response = HTTPI.get(request, adapter)
|
237
|
+
expect(response.body).to eq("get")
|
238
|
+
end
|
230
239
|
end
|
231
240
|
end
|
232
241
|
|
@@ -4,7 +4,6 @@ require "puma/minissl"
|
|
4
4
|
require "integration/support/application"
|
5
5
|
|
6
6
|
class IntegrationServer
|
7
|
-
|
8
7
|
def self.run(options = {})
|
9
8
|
server = new(options)
|
10
9
|
server.run
|
@@ -76,7 +75,7 @@ class IntegrationServer
|
|
76
75
|
|
77
76
|
context.key = IntegrationServer.ssl_key_file
|
78
77
|
context.cert = IntegrationServer.ssl_cert_file
|
79
|
-
context.verify_mode = Puma::MiniSSL::
|
78
|
+
context.verify_mode = Puma::MiniSSL::VERIFY_NONE
|
80
79
|
|
81
80
|
context
|
82
81
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
8
8
|
- Martin Tepper
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -59,28 +59,28 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '13.0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '13.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '3.5'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '3.5'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: mocha
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,14 +101,14 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
104
|
+
version: '5.0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
111
|
+
version: '5.0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: webmock
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,9 +129,9 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
+
- ".github/workflows/development.yml"
|
132
133
|
- ".gitignore"
|
133
134
|
- ".rspec"
|
134
|
-
- ".travis.yml"
|
135
135
|
- CHANGELOG.md
|
136
136
|
- Gemfile
|
137
137
|
- LICENSE
|
@@ -204,7 +204,7 @@ homepage: http://github.com/savonrb/httpi
|
|
204
204
|
licenses:
|
205
205
|
- MIT
|
206
206
|
metadata: {}
|
207
|
-
post_install_message:
|
207
|
+
post_install_message:
|
208
208
|
rdoc_options: []
|
209
209
|
require_paths:
|
210
210
|
- lib
|
@@ -212,15 +212,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
212
|
requirements:
|
213
213
|
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: '2.3'
|
216
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
217
|
requirements:
|
218
218
|
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
|
-
rubygems_version: 3.
|
223
|
-
signing_key:
|
222
|
+
rubygems_version: 3.2.7
|
223
|
+
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Common interface for Ruby's HTTP libraries
|
226
226
|
test_files: []
|