Skip to content

Commit

Permalink
Update test_puma_server_ssl.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Sep 8, 2020
1 parent ee41365 commit 1d054b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test_puma_server_ssl.rb
Expand Up @@ -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']]] }
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1d054b4

Please sign in to comment.