excon 0.52.0 → 0.53.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4fbd928d58bcca49ade92b992e6081c499c5953
4
- data.tar.gz: ffd6ef0ea40f00bae7370651713d1838da818cbb
3
+ metadata.gz: 107f2915312740816e1f7e464721943befb46df9
4
+ data.tar.gz: cf47a20d525466fc3251872cb062fc0604291cde
5
5
  SHA512:
6
- metadata.gz: ec4376d34c259d5a1db8b9f5ec85484ce8a26e22e41a737feb2c4ca584441bfeed0e51d9528c1c0b4213406047398b1af25052f4a64203750aab7bfd346435c3
7
- data.tar.gz: 049b675e456d193711f65a39c087d86d04e015dff34e0a9e30b8f04e089cf09f935f46aa21ad5f25cfa95123e5fd9ad6ca1525c3bd719aee1f6db8f11ef11632
6
+ metadata.gz: 723ddc673863eaed03cdd701e6acc96d145b91606992580f6521685e09a9698844f106b99bda867941d90854bb176eb55e6784a9815c5885212623918a99932d
7
+ data.tar.gz: c156cf208eb0a4180489c4106a38adb6b68a4e7258b34a5cdeaa86ef000d58bbe2d40e06843e32de595ae4d3cf2272dbf42e58ea9253e1202f288aa8b716b6a4
data/Gemfile CHANGED
@@ -2,8 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'jruby-openssl', :platform => :jruby
6
- gem 'puma', :groups => [:development, :test]
5
+ gem 'jruby-openssl', '~> 0.9', :platform => :jruby
7
6
  gem 'unicorn', :platforms => [:mri, :rbx], :groups => [:development, :test]
8
7
  gem 'rubysl', '~> 2.0', :platform => :rbx
9
8
  gem 'rack', '~> 1.6'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.52.0)
4
+ excon (0.53.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -10,7 +10,6 @@ GEM
10
10
  i18n (~> 0.6)
11
11
  multi_json (~> 1.0)
12
12
  backports (3.6.4)
13
- bouncy-castle-java (1.5.0147)
14
13
  chronic (0.6.7)
15
14
  delorean (2.0.0)
16
15
  chronic
@@ -20,8 +19,7 @@ GEM
20
19
  ffi2-generators (0.1.1)
21
20
  formatador (0.2.3)
22
21
  i18n (0.6.0)
23
- jruby-openssl (0.8.8)
24
- bouncy-castle-java (>= 1.5.0147)
22
+ jruby-openssl (0.9.17-java)
25
23
  json (1.8.2)
26
24
  json (1.8.2-java)
27
25
  kgio (2.9.2)
@@ -29,6 +27,7 @@ GEM
29
27
  multi_json (1.3.6)
30
28
  open4 (1.3.0)
31
29
  puma (3.6.0)
30
+ puma (3.6.0-java)
32
31
  rack (1.6.0)
33
32
  rack-protection (1.2.0)
34
33
  rack
@@ -284,7 +283,7 @@ DEPENDENCIES
284
283
  delorean
285
284
  eventmachine (>= 1.0.4)
286
285
  excon!
287
- jruby-openssl
286
+ jruby-openssl (~> 0.9)
288
287
  json (>= 1.8.2)
289
288
  open4
290
289
  puma
@@ -299,4 +298,4 @@ DEPENDENCIES
299
298
  unicorn
300
299
 
301
300
  BUNDLED WITH
302
- 1.12.5
301
+ 1.13.1
data/README.md CHANGED
@@ -413,6 +413,20 @@ connection = Excon.new('https://example.com',
413
413
 
414
414
  `client_key_pass` is optional.
415
415
 
416
+ If you already have loaded the certificate and key into memory, then pass it through like:
417
+
418
+ ```ruby
419
+ client_cert_data = File.load 'mycert.pem'
420
+ client_key_data = File.load 'mycert.key'
421
+
422
+ connection = Excon.new('https://example.com',
423
+ client_cert_data: client_cert_data,
424
+ client_key_data: client_key_data)
425
+ ```
426
+
427
+ This can be useful if your program has already loaded the assets through
428
+ another mechanism (E.g. a remote API call to a secure K:V system like Vault).
429
+
416
430
  ## HTTPS/SSL Issues
417
431
 
418
432
  By default excon will try to verify peer certificates when using HTTPS. Unfortunately on some operating systems the defaults will not work. This will likely manifest itself as something like `Excon::Errors::CertificateError: SSL_connect returned=1 ...`
@@ -1,3 +1,10 @@
1
+ 0.32.0 09/27/2016
2
+ =================
3
+
4
+ add ability to pass ssl options as strings
5
+ progress towards rspec
6
+ update bundled certs
7
+
1
8
  0.52.0 08/22/2016
2
9
  =================
3
10
 
@@ -1,7 +1,7 @@
1
1
  ##
2
2
  ## Bundle of CA Root Certificates
3
3
  ##
4
- ## Certificate data from Mozilla as of: Wed Apr 20 03:12:05 2016
4
+ ## Certificate data from Mozilla as of: Wed Sep 14 03:12:05 2016
5
5
  ##
6
6
  ## This is a bundle of X.509 certificates of public Certificate Authorities
7
7
  ## (CA). These were automatically extracted from Mozilla's root certificates
@@ -13,8 +13,8 @@
13
13
  ## an Apache+mod_ssl webserver for SSL client authentication.
14
14
  ## Just configure this file as the SSLCACertificateFile.
15
15
  ##
16
- ## Conversion done with mk-ca-bundle.pl version 1.25.
17
- ## SHA1: 5df367cda83086392e1acdf22bfef00c48d5eba6
16
+ ## Conversion done with mk-ca-bundle.pl version 1.26.
17
+ ## SHA256: 01bbf1ecdd693f554ff4dcbe15880b3e6c33188a956c15ff845d313ca69cfeb8
18
18
  ##
19
19
 
20
20
 
@@ -3863,3 +3863,174 @@ ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX
3863
3863
  is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7
3864
3864
  zAYspsbiDrW5viSP
3865
3865
  -----END CERTIFICATE-----
3866
+
3867
+ Hellenic Academic and Research Institutions RootCA 2015
3868
+ =======================================================
3869
+ -----BEGIN CERTIFICATE-----
3870
+ MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT
3871
+ BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0
3872
+ aW9ucyBDZXJ0LiB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X6hME6wGkoLfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc
3886
+ Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD
3887
+ AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI
3888
+ hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+
3889
+ D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM
3890
+ d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y
3891
+ d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn
3892
+ 82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb
3893
+ davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F
3894
+ Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt
3895
+ J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa
3896
+ JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q
3897
+ p/UsQu0yrbYhnr68
3898
+ -----END CERTIFICATE-----
3899
+
3900
+ Hellenic Academic and Research Institutions ECC RootCA 2015
3901
+ ===========================================================
3902
+ -----BEGIN CERTIFICATE-----
3903
+ MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0
3904
+ aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u
3905
+ cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj
3906
+ aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw
3907
+ MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmlj
3908
+ IEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUQwQgYD
3909
+ VQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIEVDQyBSb290
3910
+ Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKgQehLgoRc4vgxEZmGZE4JJS+dQS8KrjVP
3911
+ dJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJajq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoK
3912
+ Vlp8aQuqgAkkbH7BRqNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O
3913
+ BBYEFLQiC4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaeplSTA
3914
+ GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn
3915
+ dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR
3916
+ -----END CERTIFICATE-----
3917
+
3918
+ Certplus Root CA G1
3919
+ ===================
3920
+ -----BEGIN CERTIFICATE-----
3921
+ MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUAMD4xCzAJBgNV
3922
+ BAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTAe
3923
+ Fw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhD
3924
+ ZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQAD
3925
+ ggIPADCCAgoCggIBANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHN
3926
+ r49aiZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt6kuJPKNx
3927
+ Qv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP0FG7Yn2ksYyy/yARujVj
3928
+ BYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTv
3929
+ LRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDEEW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2
3930
+ z4QTd28n6v+WZxcIbekN1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYfFkuPSi5YXHLtaW6uOrc
3931
+ 4nBvCGrch2c0798wct3zyT8j/zXhviEpIDCB5BmlIOklynMxdCm+4kLV87ImZsdo/Rmz5yCTmehd
3932
+ 4F6H50boJZwKKSTUzViGUkAksnsPmBIgJPaQbEfIDbsYIC7Z/fyL8inqh3SV4EJQeIQEQWGw9CEj
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
3949
+ ===================
3950
+ -----BEGIN CERTIFICATE-----
3951
+ MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4xCzAJBgNVBAYT
3952
+ AkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjAeFw0x
3953
+ NDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0
3954
+ cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IA
3955
+ BM0PW1aC3/BFGtat93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uN
3956
+ Am8xIk0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0PAQH/BAQD
3957
+ AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMB8GA1Ud
3958
+ IwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqGSM49BAMDA2gAMGUCMHD+sAvZ94OX7PNV
3959
+ HdTcswYO/jOYnYs5kGuUIe22113WTNchp+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjl
3960
+ vPl5adytRSv3tjFzzAalU5ORGpOucGpnutee5WEaXw==
3961
+ -----END CERTIFICATE-----
3962
+
3963
+ OpenTrust Root CA G1
3964
+ ====================
3965
+ -----BEGIN CERTIFICATE-----
3966
+ MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59rY45nMA0GCSqGSIb3DQEBCwUAMEAxCzAJBgNV
3967
+ BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcx
3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N3DlCPaTKbYwDQYJKoZIhvcNAQELBQADggIBAB3dAmB84DWn5ph76kTOZ0BP8pNuZtQ5iSas000E
3982
+ PLuHIT839HEl2ku6q5aCgZG27dmxpGWX4m9kWaSW7mDKHyP7Rbr/jyTwyqkxf3kfgLMtMrpkZ2Cv
3983
+ uVnN35pJ06iCsfmYlIrM4LvgBBuZYLFGZdwIorJGnkSI6pN+VxbSFXJfLkur1J1juONI5f6ELlgK
3984
+ n0Md/rcYkoZDSw6cMoYsYPXpSOqV7XAp8dUv/TW0V8/bhUiZucJvbI/NeJWsZCj9VrDDb8O+WVLh
3985
+ X4SPgPL0DTatdrOjteFkdjpY3H1PXlZs5VVZV6Xf8YpmMIzUUmI4d7S+KNfKNsSbBfD4Fdvb8e80
3986
+ nR14SohWZ25g/4/Ii+GOvUKpMwpZQhISKvqxnUOOBZuZ2mKtVzazHbYNeS2WuOvyDEsMpZTGMKcm
3987
+ GS3tTAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L9109S5zvE/
3988
+ bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/KyPu1svf0OnWZzsD2097+o
3989
+ 4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJAwSQiumPv+i2tCqjI40cHLI5kqiPAlxA
3990
+ OXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj1oxx
3991
+ -----END CERTIFICATE-----
3992
+
3993
+ OpenTrust Root CA G2
3994
+ ====================
3995
+ -----BEGIN CERTIFICATE-----
3996
+ MIIFbzCCA1egAwIBAgISESChaRu/vbm9UpaPI+hIvyYRMA0GCSqGSIb3DQEBDQUAMEAxCzAJBgNV
3997
+ BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcy
3998
+ MB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMA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Kr7ge57tx+4BkJamz
4012
+ Gj5oXScmp7oq4fBXgwpkTx4idBvpkF/wrM//T2h6OKQQbA2xx6R3gBi2oihEdqc0nXGEL8pZ0keI
4013
+ mUEiyTCYYW49qKgFbdEfwFFEVn8nNQLdXpgKQuswv42hm1GqO+qTRmTFAHneIWv2V6CG1wZy7HBG
4014
+ S4tz3aAhdT7cHcCP009zHIXZ/n9iyJVvttN7jLpTwm+bREx50B1ws9efAvSyB7DH5fitIw6mVskp
4015
+ EndI2S9G/Tvw/HRwkqWOOAgfZDC2t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ
4016
+ 6e18CL13zSdkzJTaTkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97kr
4017
+ gCf2o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU3jg9CcCo
4018
+ SmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eAiN1nE28daCSLT7d0geX0
4019
+ YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14fWKGVyasvc0rQLW6aWQ9VGHgtPFGml4vm
4020
+ u7JwqkwR3v98KzfUetF3NI/n+UL3PIEMS1IK
4021
+ -----END CERTIFICATE-----
4022
+
4023
+ OpenTrust Root CA G3
4024
+ ====================
4025
+ -----BEGIN CERTIFICATE-----
4026
+ MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAxCzAJBgNVBAYT
4027
+ AkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEczMB4X
4028
+ DTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9w
4029
+ ZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQA
4030
+ IgNiAARK7liuTcpm3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5B
4031
+ ta1doYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4GA1UdDwEB
4032
+ /wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAf
4033
+ BgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAKBggqhkjOPQQDAwNpADBmAjEAj6jcnboM
4034
+ BBf6Fek9LykBl7+BFjNAk2z8+e2AcG+qj9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta
4035
+ 3U1fJAuwACEl74+nBCZx4nxp5V2a+EEfOzmTk51V6s2N8fvB
4036
+ -----END CERTIFICATE-----
@@ -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.52.0'
17
- s.date = '2016-08-22'
16
+ s.version = '0.53.0'
17
+ s.date = '2016-09-27'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -65,7 +65,9 @@ Gem::Specification.new do |s|
65
65
  s.add_development_dependency('sinatra')
66
66
  s.add_development_dependency('sinatra-contrib')
67
67
  s.add_development_dependency('json', '>= 1.8.2')
68
-
68
+ if RUBY_VERSION.to_f >= 1.9
69
+ s.add_development_dependency 'puma'
70
+ end
69
71
  ## Leave this section as-is. It will be automatically generated from the
70
72
  ## contents of your Git repository via the gemspec task. DO NOT REMOVE
71
73
  ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
@@ -127,9 +129,17 @@ Gem::Specification.new do |s|
127
129
  lib/excon/test/server.rb
128
130
  lib/excon/unix_socket.rb
129
131
  lib/excon/utils.rb
132
+ spec/excon/error_spec.rb
133
+ spec/excon/test/server_spec.rb
130
134
  spec/excon_spec.rb
131
- spec/excon_test_server_spec.rb
135
+ spec/helpers/file_path_helpers.rb
136
+ spec/requests/basic_spec.rb
137
+ spec/requests/eof_requests_spec.rb
132
138
  spec/spec_helper.rb
139
+ spec/support/shared_contexts/test_server_context.rb
140
+ spec/support/shared_examples/shared_example_for_clients.rb
141
+ spec/support/shared_examples/shared_example_for_streaming_clients.rb
142
+ spec/support/shared_examples/shared_example_for_test_servers.rb
133
143
  tests/authorization_header_tests.rb
134
144
  tests/bad_tests.rb
135
145
  tests/basic_tests.rb
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
3
 
4
- VERSION = '0.52.0'
4
+ VERSION = '0.53.0'
5
5
 
6
6
  CR_NL = "\r\n"
7
7
 
@@ -65,24 +65,19 @@ module Excon
65
65
  ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
66
66
  end
67
67
 
68
- # maintain existing API
69
- certificate_path = @data[:client_cert] || @data[:certificate_path]
70
- private_key_path = @data[:client_key] || @data[:private_key_path]
71
- private_key_pass = @data[:client_key_pass] || @data[:private_key_pass]
72
-
73
- if certificate_path && private_key_path
74
- ssl_context.cert = OpenSSL::X509::Certificate.new(File.read(certificate_path))
68
+ if client_cert_data && client_key_data
69
+ ssl_context.cert = OpenSSL::X509::Certificate.new client_cert_data
75
70
  if OpenSSL::PKey.respond_to? :read
76
- ssl_context.key = OpenSSL::PKey.read(File.read(private_key_path), private_key_pass)
71
+ ssl_context.key = OpenSSL::PKey.read(client_key_data, client_key_pass)
77
72
  else
78
- ssl_context.key = OpenSSL::PKey::RSA.new(File.read(private_key_path), private_key_pass)
73
+ ssl_context.key = OpenSSL::PKey::RSA.new(client_key_data, client_key_pass)
79
74
  end
80
75
  elsif @data.key?(:certificate) && @data.key?(:private_key)
81
76
  ssl_context.cert = OpenSSL::X509::Certificate.new(@data[:certificate])
82
77
  if OpenSSL::PKey.respond_to? :read
83
- ssl_context.key = OpenSSL::PKey.read(@data[:private_key], private_key_pass)
78
+ ssl_context.key = OpenSSL::PKey.read(@data[:private_key], client_key_pass)
84
79
  else
85
- ssl_context.key = OpenSSL::PKey::RSA.new(@data[:private_key], private_key_pass)
80
+ ssl_context.key = OpenSSL::PKey::RSA.new(@data[:private_key], client_key_pass)
86
81
  end
87
82
  end
88
83
 
@@ -141,10 +136,37 @@ module Excon
141
136
 
142
137
  private
143
138
 
139
+ def client_cert_data
140
+ @client_cert_data ||= if ccd = @data[:client_cert_data]
141
+ ccd
142
+ elsif path = @data[:client_cert]
143
+ File.read path
144
+ elsif path = @data[:certificate_path]
145
+ warn ":certificate_path is no longer supported and will be deprecated. Please use :client_cert or :client_cert_data"
146
+ File.read path
147
+ end
148
+ end
149
+
144
150
  def connect
145
151
  # backwards compatability for things lacking nonblock
146
152
  @nonblock = HAVE_NONBLOCK && @nonblock
147
153
  super
148
154
  end
155
+
156
+ def client_key_data
157
+ @client_key_data ||= if ckd = @data[:client_key_data]
158
+ ckd
159
+ elsif path = @data[:client_key]
160
+ File.read path
161
+ elsif path = @data[:private_key_path]
162
+ warn ":private_key_path is no longer supported and will be deprecated. Please use :client_key or :client_key_data"
163
+ File.read path
164
+ end
165
+ end
166
+
167
+ def client_key_pass
168
+ @data[:client_key_pass] || @data[:private_key_pass]
169
+ end
170
+
149
171
  end
150
172
  end
@@ -4,7 +4,6 @@ module Excon
4
4
  module Server
5
5
  module Puma
6
6
  def start(app_str = app, bind_uri = bind)
7
- bind.host = bind_uri.host.gsub(/[\[\]]/, '')
8
7
  open_process('puma', '-b', bind_uri.to_s, app_str)
9
8
  line = ''
10
9
  until line =~ /Use Ctrl-C to stop/
@@ -30,8 +30,7 @@ module Excon
30
30
  if args[:timeout]
31
31
  @timeout = args[:timeout]
32
32
  else
33
- # Double the default timeout if jruby because of the startup cost
34
- @timeout = RUBY_PLATFORM == "java" ? 20 : 10
33
+ @timeout = 20
35
34
  end
36
35
  name = @server.to_s.split('_').collect(&:capitalize).join
37
36
  plug = nested_const_get("Excon::Test::Plugin::Server::#{name}")
@@ -72,7 +71,7 @@ module Excon
72
71
  true
73
72
  end
74
73
  def dump_errors
75
- lines = error.read.split($INPUT_RECORD_SEPARATOR)
74
+ lines = error.read.split($/)
76
75
  while line = lines.shift
77
76
  case line
78
77
  when /(ERROR|Error)/
@@ -0,0 +1,137 @@
1
+ describe Excon::Error do
2
+ # Regression against e300458f2d9330cb265baeb8973120d08c665d9
3
+ describe '#status_errors' do
4
+ describe '.keys ' do
5
+ expected = [
6
+ 100,
7
+ 101,
8
+ (200..206).to_a,
9
+ (300..307).to_a,
10
+ (400..417).to_a,
11
+ 422,
12
+ 429,
13
+ (500..504).to_a
14
+ ].flatten
15
+
16
+ it('returns the pertinent HTTP error numbers') do
17
+ expected.flatten == Excon::Error.status_errors.keys
18
+ end
19
+ end
20
+ end
21
+
22
+ describe '#new' do
23
+ it('returns an Excon::Error') do
24
+ expect(Excon::Error.new('bar').class == Excon::Error).to be true
25
+ end
26
+ it('raises errors for bad URIs') do
27
+ expect { Excon.new('foo') }.to raise_error(ArgumentError)
28
+ end
29
+
30
+ it('raises errors for bad paths') do
31
+ expect { Excon.new('http://localhost', path: "foo\r\nbar: baz") }.to raise_error(URI::InvalidURIError)
32
+ end
33
+ end
34
+
35
+ context 'when remaining backwards compatible' do
36
+ describe '#new' do
37
+ it 'should raise standard error and catch standard error' do
38
+ expect { raise Excon::Error::Client, 'foo' }.to raise_error(Excon::Error)
39
+ end
40
+
41
+ it 'should raise legacy errors and catch legacy errors' do
42
+ expect do
43
+ raise Excon::Errors::Error, 'bar'
44
+ end.to raise_error(Excon::Errors::Error)
45
+ end
46
+
47
+ it 'should raise standard error and catch legacy errors' do
48
+ expect do
49
+ raise Excon::Error::NotFound, 'bar'
50
+ end.to raise_error(Excon::Errors::Error)
51
+ end
52
+ end
53
+
54
+ describe '#status_error' do
55
+ it 'should raise with status_error() and catch with standard error' do
56
+ expect do
57
+ raise Excon::Error.status_error({ expects: 200 }, status: 400)
58
+ end.to raise_error(Excon::Error)
59
+ end
60
+
61
+ it 'should raise with status_error() and catch with legacy error' do
62
+ expect do
63
+ raise Excon::Error.status_error({ expects: 200 }, status: 400)
64
+ end.to raise_error(Excon::Errors::BadRequest)
65
+ end
66
+
67
+ it 'should raise with legacy status_error() and catch with standard' do
68
+ expect do
69
+ raise Excon::Errors.status_error({ expects: 200 }, status: 400)
70
+ end.to raise_error(Excon::Error)
71
+ end
72
+ end
73
+ end
74
+
75
+ context 'when exceptions are rescued' do
76
+ include_context("test server", :exec, 'error.rb', :before => :start, :after => :stop )
77
+
78
+ context 'when :debug_request and :debug_response are switched off' do
79
+ it('exception message does not include response or response info') do
80
+ begin
81
+ Excon.get('http://127.0.0.1:9292/error/not_found', expects: 200)
82
+ rescue Excon::Errors::HTTPStatusError => err
83
+ truth =
84
+ err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
85
+ !err.message.include?('excon.error.request') &&
86
+ !err.message.include?('excon.error.response')
87
+ expect(truth).to be true
88
+ end
89
+ end
90
+ end
91
+
92
+ context 'when :debug_request and :debug_response are switched on' do
93
+ it 'exception message includes request and response info' do
94
+ begin
95
+ Excon.get('http://127.0.0.1:9292/error/not_found', expects: 200,
96
+ debug_request: true, debug_response: true)
97
+ rescue Excon::Errors::HTTPStatusError => err
98
+ truth =
99
+ err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
100
+ err.message.include?('excon.error.request') &&
101
+ err.message.include?('excon.error.response')
102
+ expect(truth).to be true
103
+ end
104
+ end
105
+ end
106
+
107
+ context 'when only :debug_request is turned on' do
108
+ it('exception message includes only request info') do
109
+ begin
110
+ Excon.get('http://127.0.0.1:9292/error/not_found', expects: 200,
111
+ debug_request: true)
112
+ rescue Excon::Errors::HTTPStatusError => err
113
+ truth =
114
+ err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
115
+ err.message.include?('excon.error.request') &&
116
+ !err.message.include?('excon.error.response')
117
+ expect(truth).to be true
118
+ end
119
+ end
120
+ end
121
+
122
+ context 'when only :debug_response is turned on ' do
123
+ it('exception message includes only response info') do
124
+ begin
125
+ Excon.get('http://127.0.0.1:9292/error/not_found', expects: 200,
126
+ debug_response: true)
127
+ rescue Excon::Errors::HTTPStatusError => err
128
+ truth =
129
+ err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
130
+ !err.message.include?('excon.error.request') &&
131
+ err.message.include?('excon.error.response')
132
+ expect(truth).to be true
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end