httpx 0.24.4 → 0.24.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes/0_24_5.md +6 -0
- data/lib/httpx/io/ssl.rb +4 -4
- data/lib/httpx/resolver/https.rb +4 -4
- data/lib/httpx/version.rb +1 -1
- data/sig/io/ssl.rbs +5 -4
- data/sig/resolver/https.rbs +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d9a59fa9d9cc1908f3135c38d9a8cb132312c0539795d3a341d87da3755d23
|
4
|
+
data.tar.gz: 8e88ca75fceac380b8fbb31fa627f3a30a2b938e2527baffbc2db00db64b76e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe80712332209f6b188eca10aea16f0d1cb02b8af18682e6efda3844cd5d5de9e99cb0829cf162433fe85f7a070865808caa32a69df3ebe84b7dd483c105315f
|
7
|
+
data.tar.gz: 1ec1dd55a8ec80bceaab32a39dfa2e325f01f83c5e512be5c74feb8f4049ef9f34431ab6d33d00ad4b6fcf906d7883a0420e91a0663f2eb4fdd6ddb632b4d351
|
data/lib/httpx/io/ssl.rb
CHANGED
@@ -4,7 +4,6 @@ require "openssl"
|
|
4
4
|
|
5
5
|
module HTTPX
|
6
6
|
TLSError = OpenSSL::SSL::SSLError
|
7
|
-
IPRegex = Regexp.union(Resolv::IPv4::Regex, Resolv::IPv6::Regex)
|
8
7
|
|
9
8
|
class SSL < TCP
|
10
9
|
using RegexpExtensions unless Regexp.method_defined?(:match?)
|
@@ -41,7 +40,6 @@ module HTTPX
|
|
41
40
|
yield(self) if block_given?
|
42
41
|
end
|
43
42
|
|
44
|
-
@hostname_is_ip = IPRegex.match?(@sni_hostname)
|
45
43
|
@verify_hostname = @ctx.verify_hostname
|
46
44
|
end
|
47
45
|
|
@@ -89,14 +87,16 @@ module HTTPX
|
|
89
87
|
@state != :connected
|
90
88
|
|
91
89
|
unless @io.is_a?(OpenSSL::SSL::SSLSocket)
|
92
|
-
if @
|
90
|
+
if (hostname_is_ip = (@ip == @sni_hostname))
|
91
|
+
# IPv6 address would be "[::1]", must turn to "0000:0000:0000:0000:0000:0000:0000:0001" for cert SAN check
|
92
|
+
@sni_hostname = @ip.to_string
|
93
93
|
# IP addresses in SNI is not valid per RFC 6066, section 3.
|
94
94
|
@ctx.verify_hostname = false
|
95
95
|
end
|
96
96
|
|
97
97
|
@io = OpenSSL::SSL::SSLSocket.new(@io, @ctx)
|
98
98
|
|
99
|
-
@io.hostname = @sni_hostname unless
|
99
|
+
@io.hostname = @sni_hostname unless hostname_is_ip
|
100
100
|
@io.session = @ssl_session unless ssl_session_expired?
|
101
101
|
@io.sync_close = true
|
102
102
|
end
|
data/lib/httpx/resolver/https.rb
CHANGED
@@ -132,7 +132,7 @@ module HTTPX
|
|
132
132
|
|
133
133
|
case code
|
134
134
|
when :ok
|
135
|
-
parse_addresses(result)
|
135
|
+
parse_addresses(result, request)
|
136
136
|
when :no_domain_found
|
137
137
|
# Indicates no such domain was found.
|
138
138
|
|
@@ -146,13 +146,13 @@ module HTTPX
|
|
146
146
|
|
147
147
|
emit_resolve_error(connection)
|
148
148
|
when :decode_error
|
149
|
-
host
|
150
|
-
reset_hostname(host)
|
149
|
+
host = @requests.delete(request)
|
150
|
+
connection = reset_hostname(host)
|
151
151
|
emit_resolve_error(connection, connection.origin.host, result)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
def parse_addresses(answers)
|
155
|
+
def parse_addresses(answers, request)
|
156
156
|
if answers.empty?
|
157
157
|
# no address found, eliminate candidates
|
158
158
|
host = @requests.delete(request)
|
data/lib/httpx/version.rb
CHANGED
data/sig/io/ssl.rbs
CHANGED
@@ -1,8 +1,4 @@
|
|
1
1
|
module HTTPX
|
2
|
-
IPRegex: Regexp
|
3
|
-
|
4
|
-
@ctx: OpenSSL::SSL::SSLContext
|
5
|
-
@verify_hostname: bool
|
6
2
|
|
7
3
|
class TLSError < OpenSSL::SSL::SSLError
|
8
4
|
end
|
@@ -10,6 +6,11 @@ module HTTPX
|
|
10
6
|
class SSL < TCP
|
11
7
|
TLS_OPTIONS: Hash[Symbol, untyped]
|
12
8
|
|
9
|
+
@ctx: OpenSSL::SSL::SSLContext
|
10
|
+
@verify_hostname: bool
|
11
|
+
|
12
|
+
attr_writer ssl_session: OpenSSL::SSL::Session?
|
13
|
+
|
13
14
|
# TODO: lift when https://github.com/ruby/rbs/issues/1497 fixed
|
14
15
|
# def initialize: (URI::Generic origin, Array[ipaddr]? addresses, options options) ?{ (self) -> void } -> void
|
15
16
|
|
data/sig/resolver/https.rbs
CHANGED
@@ -32,6 +32,8 @@ module HTTPX
|
|
32
32
|
|
33
33
|
def parse: (Request request, Response response) -> void
|
34
34
|
|
35
|
+
def parse_addresses: (Array[dns_result] answers, Request request) -> void
|
36
|
+
|
35
37
|
def build_request: (String hostname) -> Request
|
36
38
|
|
37
39
|
def decode_response_body: (Response) -> dns_decoding_response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -104,6 +104,7 @@ extra_rdoc_files:
|
|
104
104
|
- doc/release_notes/0_24_2.md
|
105
105
|
- doc/release_notes/0_24_3.md
|
106
106
|
- doc/release_notes/0_24_4.md
|
107
|
+
- doc/release_notes/0_24_5.md
|
107
108
|
- doc/release_notes/0_2_0.md
|
108
109
|
- doc/release_notes/0_2_1.md
|
109
110
|
- doc/release_notes/0_3_0.md
|
@@ -200,6 +201,7 @@ files:
|
|
200
201
|
- doc/release_notes/0_24_2.md
|
201
202
|
- doc/release_notes/0_24_3.md
|
202
203
|
- doc/release_notes/0_24_4.md
|
204
|
+
- doc/release_notes/0_24_5.md
|
203
205
|
- doc/release_notes/0_2_0.md
|
204
206
|
- doc/release_notes/0_2_1.md
|
205
207
|
- doc/release_notes/0_3_0.md
|