standard_id 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d7f2bce088273acf1c2601b85b0c1fc5f72cd36d465fc7370c3b9e2f651166d
4
- data.tar.gz: a45562de00f147d69627dc2a377e645c167d8814e34c824eee2a38893c6727df
3
+ metadata.gz: 980f1a28f34af1f7255514b5e09f7dc994d613673efb6e145827a6ddafe7fb5c
4
+ data.tar.gz: 4a663933f61433dc0236d4b2847c8005687a915a595dd00bc8dbfdc48084b40b
5
5
  SHA512:
6
- metadata.gz: ef7e0f56d1d5575727c4a18f4b13daae6afafd58a40a0871a511feaf4b212e2d9f631033f9034f82f16833ac5f022c656fb5addd7653719f66b4892fad78ea4f
7
- data.tar.gz: 1a0d7b18b6d166deba7fa54cd14bc2ddc7d6fffec7583decd984d27bcf91844da0469ebc1f1760f22e5fe9ea8cced5bd67ffabb22ee663dcb667335d094ea530
6
+ metadata.gz: 8b4871d0545f56edd61faa5d076219c2eef54dc65f5466987194c86b5a136fc013a55a9b836b8c7ad667e9f1ed510f8c65e8b4b69dfe8f9ba5f1b280fdcdad99
7
+ data.tar.gz: e890d50f439fcc48f0d741947b9e2674f83fbfc5701f1d159a0a3d8f70397f369f7af79a02d8b6484bd6869bbc553f1f8970a34cba3cdcced174e4bd7e379ac6
@@ -60,19 +60,15 @@ module StandardId
60
60
  end
61
61
 
62
62
  def start_connection(uri, resolved_ip: nil, &block)
63
- host = resolved_ip || uri.host
64
- options = {
65
- use_ssl: uri.scheme == "https",
66
- open_timeout: OPEN_TIMEOUT,
67
- read_timeout: READ_TIMEOUT
68
- }
69
- options[:verify_mode] = OpenSSL::SSL::VERIFY_PEER if options[:use_ssl]
70
-
71
- Net::HTTP.start(host, uri.port, **options) do |http|
72
- # Set Host header for virtual hosting when connecting to resolved IP
73
- http.instance_variable_set(:@address, uri.host) if resolved_ip
74
- yield http
75
- end
63
+ http = Net::HTTP.new(uri.host, uri.port)
64
+ http.use_ssl = (uri.scheme == "https")
65
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER if http.use_ssl?
66
+ http.open_timeout = OPEN_TIMEOUT
67
+ http.read_timeout = READ_TIMEOUT
68
+ # Pin to the resolved IP for SSRF/DNS-rebinding protection while
69
+ # preserving the original hostname for TLS SNI and cert verification.
70
+ http.ipaddr = resolved_ip if resolved_ip
71
+ http.start(&block)
76
72
  end
77
73
  end
78
74
  end
@@ -1,3 +1,3 @@
1
1
  module StandardId
2
- VERSION = "0.14.0"
2
+ VERSION = "0.14.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryl Sim