excon 0.39.3 → 0.39.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjUyYzk4Mzc5ZWNhZjc2ZmY1OTFhNjEwMWZjMDQyMGY2MWZmZGFhMg==
4
+ YTI3MWJmMGU1ZTg0OTg2ZWIwOTAyNzM4MTk2NWJkOTIwZjgwOGFkZg==
5
5
  data.tar.gz: !binary |-
6
- YzhkZWViOWYyNjY1ZGRhYmVmODY4YTk0N2M5YWI3NmQ3NWUxMGFkZA==
6
+ MmZkOTNlY2Q4MzU1NmVhYmNjZWU3NmYyYzZkNTFiMTliM2M1ZWNmMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTVlMTFiNjFlNDEzNWI0NGNmZWJhNmU4ODYwYmI2ZDc3ZDNhOGY0ZTllMGY1
10
- YWQ2NWFlOGZmM2I5MjJjZWI5M2Q5MTNlNmNjNjY4M2MwMTljZDk3ZTgwNTlk
11
- YzU5NTc2Zjg5YmMxM2U2YjY1YzAyMTQ1ZjM4NjM4MWVkNWNmZmQ=
9
+ OTYyYTE2YTRhNjcyZTBhZTQ4ODhkYjI2MDAwN2U3NWZjYTBlYjhkYTFjMjdj
10
+ ZTc3NjJlNmNmZmIxNzY5ZmYwNjA1ZWNhYjhlNmU5ZjAxNTg3YjQwNTgwYmFj
11
+ OTc2Mjc3MGE3ODU0MTM4N2YxMDA5MmY3NjQ0OGYwZWEyNDYxNWI=
12
12
  data.tar.gz: !binary |-
13
- MjI0Yzg2MDY1MWQ2YWYwMTg1MGFiYTZmOGUwOTVmMjQzZGZiZTAzNjY0Nzhi
14
- N2EzNGU3YTRmYmJkYmRlZDllMzcyMzI2MDRlZTNiNWQyZDViNTQ4YjAzY2Q4
15
- YzVkNzQ3ZTZiOTE4MmViZTg2NDZmZWYzY2Q3MjE0NmY1NThmZWY=
13
+ NjE0MmRlMjM2OGM4MzkzNTc1YjU1OTU2NGY5YmNhMDIwNjdlNGFlNjUzMzRi
14
+ NzdmNjAxMzVhMTkxNjllM2EwYWU4OGU3NDBlN2NjNmM0NDIxNTY1NTU1OTAz
15
+ MWYyYTg5NTFlMjUwYzRhMDlkYWYxYTUyYTk5YWI3N2U5MjM4MzI=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.39.3)
4
+ excon (0.39.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -344,6 +344,19 @@ For debugging purposes you can also use Excon::StandardInstrumentor to output al
344
344
 
345
345
  See [the documentation for ActiveSupport::Notifications](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) for more detail on using the subscription interface. See excon's [instrumentation_test.rb](https://github.com/excon/excon/blob/master/tests/middlewares/instrumentation_tests.rb) for more examples of instrumenting excon.
346
346
 
347
+ ## HTTPS client certificate
348
+
349
+ You can supply a client side certificate if the server requires it for authentication:
350
+
351
+ ```ruby
352
+ connection = Excon.new('https://example.com',
353
+ client_cert: 'mycert.pem',
354
+ client_key: 'mycert.key',
355
+ client_key_pass: 'my pass phrase')
356
+ ```
357
+
358
+ `client_key_pass` is optional.
359
+
347
360
  ## HTTPS/SSL Issues
348
361
 
349
362
  By default excon will try to verify peer certificates when using SSL for HTTPS. Unfortunately on some operating systems the defaults will not work. This will likely manifest itself as something like `Excon::Errors::SocketError: SSL_connect returned=1 ...`
@@ -1,3 +1,9 @@
1
+ 0.39.4 08/08/2014
2
+ =================
3
+
4
+ ensure Response#new uses case-insensitive headers
5
+ add client cert pass phrase support
6
+
1
7
  0.39.3 08/05/2014
2
8
  =================
3
9
 
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'excon'
16
- s.version = '0.39.3'
17
- s.date = '2014-08-05'
16
+ s.version = '0.39.4'
17
+ s.date = '2014-08-08'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.39.3'
3
+ VERSION = '0.39.4'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
@@ -14,6 +14,8 @@ module Excon
14
14
  alias_method :raw_include?, :include?
15
15
  alias_method :raw_key?, :key?
16
16
  alias_method :raw_member?, :member?
17
+ alias_method :raw_merge, :merge
18
+ alias_method :raw_merge!, :merge!
17
19
  alias_method :raw_rehash, :rehash
18
20
  alias_method :raw_store, :store
19
21
  alias_method :raw_values_at, :values_at
@@ -57,9 +59,20 @@ module Excon
57
59
  raw_key?(key) || @downcased.has_key?(key.downcase)
58
60
  end
59
61
 
62
+ def merge(other_hash)
63
+ self.dup.merge!(other_hash)
64
+ end
65
+
66
+ def merge!(other_hash)
67
+ other_hash.each do |key, value|
68
+ self[key] = value
69
+ end
70
+ raw_merge!(other_hash)
71
+ end
72
+
60
73
  def rehash
61
- raw_rehash
62
74
  @downcased.rehash
75
+ raw_rehash
63
76
  end
64
77
 
65
78
  def values_at(*keys)
@@ -159,9 +159,10 @@ module Excon
159
159
 
160
160
  def initialize(params={})
161
161
  @data = {
162
- :body => '',
163
- :headers => Excon::Headers.new
162
+ :body => ''
164
163
  }.merge(params)
164
+ @data[:headers] = Excon::Headers.new.merge!(params[:headers] || {})
165
+
165
166
  @body = @data[:body]
166
167
  @headers = @data[:headers]
167
168
  @status = @data[:status]
@@ -63,13 +63,14 @@ module Excon
63
63
  # maintain existing API
64
64
  certificate_path = @data[:client_cert] || @data[:certificate_path]
65
65
  private_key_path = @data[:client_key] || @data[:private_key_path]
66
+ private_key_pass = @data[:client_key_pass] || @data[:private_key_pass]
66
67
 
67
68
  if certificate_path && private_key_path
68
69
  ssl_context.cert = OpenSSL::X509::Certificate.new(File.read(certificate_path))
69
- ssl_context.key = OpenSSL::PKey::RSA.new(File.read(private_key_path))
70
+ ssl_context.key = OpenSSL::PKey::RSA.new(File.read(private_key_path), private_key_pass)
70
71
  elsif @data.has_key?(:certificate) && @data.has_key?(:private_key)
71
72
  ssl_context.cert = OpenSSL::X509::Certificate.new(@data[:certificate])
72
- ssl_context.key = OpenSSL::PKey::RSA.new(@data[:private_key])
73
+ ssl_context.key = OpenSSL::PKey::RSA.new(@data[:private_key], private_key_pass)
73
74
  end
74
75
 
75
76
  if @data[:proxy]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.39.3
4
+ version: 0.39.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-08-05 00:00:00.000000000 Z
13
+ date: 2014-08-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport