diff --git a/test/test_puma_server_ssl.rb b/test/test_puma_server_ssl.rb index 60a1c9e573..d057b6577f 100644 --- a/test/test_puma_server_ssl.rb +++ b/test/test_puma_server_ssl.rb @@ -208,7 +208,7 @@ class TestPumaServerSSLClient < Minitest::Test CERT_PATH = File.expand_path "../examples/puma/client-certs", __dir__ def assert_ssl_client_error_match(error, subject=nil, &blk) - host = "localhost" + host = "127.0.0.1" port = UniquePort.call app = lambda { |env| [200, {}, [env['rack.url_scheme']]] } @@ -227,7 +227,6 @@ def assert_ssl_client_error_match(error, subject=nil, &blk) events = SSLEventsHelper.new STDOUT, STDERR server = Puma::Server.new app, events server.add_ssl_listener host, port, ctx - host_addr = server.binder.ios.first.to_io.addr[2] server.run http = Net::HTTP.new host, port @@ -254,7 +253,7 @@ def assert_ssl_client_error_match(error, subject=nil, &blk) # so we can't inspect the messages here unless Puma.jruby? assert_match error, events.error.message if error - assert_equal host_addr, events.addr if error + assert_equal host, events.addr if error assert_equal subject, events.cert.subject.to_s if subject end ensure