excon 0.73.0 → 0.74.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/cacert.pem +23 -23
- data/lib/excon/connection.rb +83 -52
- data/lib/excon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0829b011c12032763ab3958668882f930250e9544fca526f4e09ebfe79ce1bf
|
4
|
+
data.tar.gz: 246229f30d08a81e9a8ecbb5195952a289e11f577ba055f1da163eada743e690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da31402d280f02562ee5ba62fa287f812fa4e40b1a03d968c9f6adff7fd499a0816ff6c32508b3451d433a8ed294bb45747bc0e45af30ab0914b346fa3479d8f
|
7
|
+
data.tar.gz: 6d792084962623065d48609dffbe0499ae6289d24bdf95f3535ff9530626349ac121b996bc4800723666a9c59dc5bf8e9b4dde59224d89166fc7fa0e3da01687
|
data/data/cacert.pem
CHANGED
@@ -130,29 +130,29 @@ Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
|
|
130
130
|
RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
|
131
131
|
-----END CERTIFICATE-----
|
132
132
|
|
133
|
-
AddTrust External Root
|
134
|
-
======================
|
135
|
-
-----BEGIN CERTIFICATE-----
|
136
|
-
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
|
137
|
-
QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
|
138
|
-
VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMD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WxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
|
152
|
-
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355
|
153
|
-
e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
|
154
|
-
G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
|
155
|
-
-----END CERTIFICATE-----
|
133
|
+
## AddTrust External Root
|
134
|
+
## ======================
|
135
|
+
## -----BEGIN CERTIFICATE-----
|
136
|
+
## MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
|
137
|
+
## QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
|
138
|
+
## VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw
|
139
|
+
## NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU
|
140
|
+
## cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg
|
141
|
+
## Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821
|
142
|
+
## +iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw
|
143
|
+
## Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo
|
144
|
+
## aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy
|
145
|
+
## 2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7
|
146
|
+
## 7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P
|
147
|
+
## BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL
|
148
|
+
## VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk
|
149
|
+
## VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
|
150
|
+
## IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
|
151
|
+
## j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
|
152
|
+
## 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355
|
153
|
+
## e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
|
154
|
+
## G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
|
155
|
+
## -----END CERTIFICATE-----
|
156
156
|
|
157
157
|
Entrust Root Certification Authority
|
158
158
|
====================================
|
data/lib/excon/connection.rb
CHANGED
@@ -488,6 +488,47 @@ module Excon
|
|
488
488
|
end
|
489
489
|
end
|
490
490
|
|
491
|
+
def proxy_match_host_port(host, port)
|
492
|
+
host_match = if host.is_a? IPAddr
|
493
|
+
begin
|
494
|
+
host.include? @data[:host]
|
495
|
+
rescue IPAddr::Error
|
496
|
+
false
|
497
|
+
end
|
498
|
+
else
|
499
|
+
/(^|\.)#{host}$/.match(@data[:host])
|
500
|
+
end
|
501
|
+
host_match && (port.nil? || port.to_i == @data[:port])
|
502
|
+
end
|
503
|
+
|
504
|
+
def proxy_from_env
|
505
|
+
if (no_proxy_env = ENV['no_proxy'] || ENV['NO_PROXY'])
|
506
|
+
no_proxy_list = no_proxy_env.scan(/\s*(?:\[([\dA-Fa-f:\/]+)\]|\*?\.?([^\s,:]+))(?::(\d+))?\s*/i).map { |e|
|
507
|
+
if e[0]
|
508
|
+
begin
|
509
|
+
[IPAddr.new(e[0]), e[2]]
|
510
|
+
rescue IPAddr::Error
|
511
|
+
nil
|
512
|
+
end
|
513
|
+
else
|
514
|
+
begin
|
515
|
+
[IPAddr.new(e[1]), e[2]]
|
516
|
+
rescue IPAddr::Error
|
517
|
+
[e[1], e[2]]
|
518
|
+
end
|
519
|
+
end
|
520
|
+
}.reject { |e| e.nil? || e[0].nil? }
|
521
|
+
end
|
522
|
+
|
523
|
+
unless no_proxy_env && no_proxy_list.index { |h| proxy_match_host_port(h[0], h[1]) }
|
524
|
+
if @data[:scheme] == HTTPS && (ENV.has_key?('https_proxy') || ENV.has_key?('HTTPS_PROXY'))
|
525
|
+
@data[:proxy] = ENV['https_proxy'] || ENV['HTTPS_PROXY']
|
526
|
+
elsif (ENV.has_key?('http_proxy') || ENV.has_key?('HTTP_PROXY'))
|
527
|
+
@data[:proxy] = ENV['http_proxy'] || ENV['HTTP_PROXY']
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|
531
|
+
|
491
532
|
def setup_proxy
|
492
533
|
if @data[:disable_proxy]
|
493
534
|
if @data[:proxy]
|
@@ -496,64 +537,54 @@ module Excon
|
|
496
537
|
return
|
497
538
|
end
|
498
539
|
|
499
|
-
|
500
|
-
|
501
|
-
|
540
|
+
return if @data[:scheme] == UNIX
|
541
|
+
|
542
|
+
proxy_from_env
|
543
|
+
|
544
|
+
case @data[:proxy]
|
545
|
+
when nil
|
546
|
+
@data.delete(:proxy)
|
547
|
+
when ''
|
548
|
+
@data.delete(:proxy)
|
549
|
+
when Hash
|
550
|
+
# no processing needed
|
551
|
+
when String, URI
|
552
|
+
uri = @data[:proxy].is_a?(String) ? URI.parse(@data[:proxy]) : @data[:proxy]
|
553
|
+
@data[:proxy] = {
|
554
|
+
:host => uri.host,
|
555
|
+
:hostname => uri.hostname,
|
556
|
+
# path is only sensible for a Unix socket proxy
|
557
|
+
:path => uri.scheme == UNIX ? uri.path : nil,
|
558
|
+
:port => uri.port,
|
559
|
+
:scheme => uri.scheme,
|
560
|
+
}
|
561
|
+
if uri.password
|
562
|
+
@data[:proxy][:password] = uri.password
|
502
563
|
end
|
503
|
-
|
504
|
-
|
505
|
-
if @data[:scheme] == HTTPS && (ENV.has_key?('https_proxy') || ENV.has_key?('HTTPS_PROXY'))
|
506
|
-
@data[:proxy] = ENV['https_proxy'] || ENV['HTTPS_PROXY']
|
507
|
-
elsif (ENV.has_key?('http_proxy') || ENV.has_key?('HTTP_PROXY'))
|
508
|
-
@data[:proxy] = ENV['http_proxy'] || ENV['HTTP_PROXY']
|
509
|
-
end
|
564
|
+
if uri.user
|
565
|
+
@data[:proxy][:user] = uri.user
|
510
566
|
end
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
when ''
|
516
|
-
@data.delete(:proxy)
|
517
|
-
when Hash
|
518
|
-
# no processing needed
|
519
|
-
when String, URI
|
520
|
-
uri = @data[:proxy].is_a?(String) ? URI.parse(@data[:proxy]) : @data[:proxy]
|
521
|
-
@data[:proxy] = {
|
522
|
-
:host => uri.host,
|
523
|
-
:hostname => uri.hostname,
|
524
|
-
# path is only sensible for a Unix socket proxy
|
525
|
-
:path => uri.scheme == UNIX ? uri.path : nil,
|
526
|
-
:port => uri.port,
|
527
|
-
:scheme => uri.scheme,
|
528
|
-
}
|
529
|
-
if uri.password
|
530
|
-
@data[:proxy][:password] = uri.password
|
531
|
-
end
|
532
|
-
if uri.user
|
533
|
-
@data[:proxy][:user] = uri.user
|
534
|
-
end
|
535
|
-
if @data[:proxy][:scheme] == UNIX
|
536
|
-
if @data[:proxy][:host]
|
537
|
-
raise ArgumentError, "The `:host` parameter should not be set for `unix://` proxies.\n" +
|
538
|
-
"When supplying a `unix://` URI, it should start with `unix:/` or `unix:///`."
|
539
|
-
end
|
540
|
-
else
|
541
|
-
unless uri.host && uri.port && uri.scheme
|
542
|
-
raise Excon::Errors::ProxyParse, "Proxy is invalid"
|
543
|
-
end
|
567
|
+
if @data[:proxy][:scheme] == UNIX
|
568
|
+
if @data[:proxy][:host]
|
569
|
+
raise ArgumentError, "The `:host` parameter should not be set for `unix://` proxies.\n" +
|
570
|
+
"When supplying a `unix://` URI, it should start with `unix:/` or `unix:///`."
|
544
571
|
end
|
545
572
|
else
|
546
|
-
|
573
|
+
unless uri.host && uri.port && uri.scheme
|
574
|
+
raise Excon::Errors::ProxyParse, "Proxy is invalid"
|
575
|
+
end
|
547
576
|
end
|
577
|
+
else
|
578
|
+
raise Excon::Errors::ProxyParse, "Proxy is invalid"
|
579
|
+
end
|
548
580
|
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
end
|
581
|
+
if @data.has_key?(:proxy) && @data[:scheme] == 'http'
|
582
|
+
@data[:headers]['Proxy-Connection'] ||= 'Keep-Alive'
|
583
|
+
# https credentials happen in handshake
|
584
|
+
if @data[:proxy].has_key?(:user) || @data[:proxy].has_key?(:password)
|
585
|
+
user, pass = Utils.unescape_form(@data[:proxy][:user].to_s), Utils.unescape_form(@data[:proxy][:password].to_s)
|
586
|
+
auth = ["#{user}:#{pass}"].pack('m').delete(Excon::CR_NL)
|
587
|
+
@data[:headers]['Proxy-Authorization'] = 'Basic ' + auth
|
557
588
|
end
|
558
589
|
end
|
559
590
|
end
|
data/lib/excon/version.rb
CHANGED
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.
|
4
|
+
version: 0.74.0
|
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: 2020-
|
13
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|