Skip to content

Commit f81c2cc

Browse files
committed
Revert "Fix invalid use of IP addresses in SNI"
This reverts commit b5c6876. The commit will not longer be needed after changes to net/http are merged to not set IP addresses as SNI server names.
1 parent b5c6876 commit f81c2cc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

test/webrick/test_httpproxy.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def test_connect
282282
# 3. ------- GET or POST ---------->
283283
#
284284
key = TEST_KEY_RSA2048
285-
cert = make_certificate(key, "localhost")
285+
cert = make_certificate(key, "127.0.0.1")
286286
s_config = {
287287
:SSLEnable =>true,
288288
:ServerName => "localhost",
@@ -300,7 +300,7 @@ def test_connect
300300
res.body = "SSL #{req.request_method} #{req.path} #{req.body}"
301301
}
302302
TestWEBrick.start_httpproxy(config){|server, addr, port, log|
303-
http = Net::HTTP.new("localhost", s_port, addr, port)
303+
http = Net::HTTP.new("127.0.0.1", s_port, addr, port)
304304
http.use_ssl = true
305305
http.verify_callback = Proc.new do |preverify_ok, store_ctx|
306306
store_ctx.current_cert.to_der == cert.to_der
@@ -398,7 +398,7 @@ def test_upstream_proxy
398398
# 3. ---------- GET or POST -------------->
399399
#
400400
key = TEST_KEY_RSA2048
401-
cert = make_certificate(key, "localhost")
401+
cert = make_certificate(key, "127.0.0.1")
402402
s_config = {
403403
:SSLEnable =>true,
404404
:ServerName => "localhost",
@@ -409,7 +409,7 @@ def test_upstream_proxy
409409
s_server.mount_proc("/"){|req2, res|
410410
res.body = "SSL #{req2.request_method} #{req2.path} #{req2.body}"
411411
}
412-
http = Net::HTTP.new("localhost", s_port, addr, port, up_log.call + log.call + s_log.call)
412+
http = Net::HTTP.new("127.0.0.1", s_port, addr, port, up_log.call + log.call + s_log.call)
413413
http.use_ssl = true
414414
http.verify_callback = Proc.new do |preverify_ok, store_ctx|
415415
store_ctx.current_cert.to_der == cert.to_der

test/webrick/test_https.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ def empty_log.<<(str)
1717
class HTTPSNITest < ::Net::HTTP
1818
attr_accessor :sni_hostname
1919

20-
def connect
21-
@address = 'localhost' if @address == '127.0.0.1'
22-
super
23-
end
24-
2520
def ssl_socket_connect(s, timeout)
2621
s.hostname = sni_hostname
2722
super

0 commit comments

Comments
 (0)