Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify_callback not being called during WEBRick HTTPS test #202

Open
headius opened this issue Jun 1, 2020 · 1 comment
Open

verify_callback not being called during WEBRick HTTPS test #202

headius opened this issue Jun 1, 2020 · 1 comment

Comments

@headius
Copy link
Member

headius commented Jun 1, 2020

While working on jruby/jruby#6246 I found that the test_sni test in WEBrick's test_ssl.rb is failing because a verify_callback is not being called.

The assertion in question is here: https://github.com/ruby/webrick/blob/2c912ded39f2d3046203cde8b169dcf2c267017e/test/webrick/test_https.rb#L41

The callback is set just north of that line, and is intended to capture the subject. However since it never gets called, subject remains nil and the assertion fails.

@headius
Copy link
Member Author

headius commented Jun 1, 2020

The test is easy to run:

$ ruby -Ilib -Itest/lib test/webrick/test_https.rb -n test_sni

And the error that results:

TestWEBrickHTTPS#test_sni [/Users/headius/projects/webrick/test/webrick/utils.rb:72]:
exceptions on 1 threads:
#<Thread:0x61f05988@/Users/headius/projects/webrick/test/webrick/utils.rb:65 dead>:
/Users/headius/projects/webrick/test/lib/minitest/unit.rb:201:in `assert': <"/CN=localhost"> expected but was
<nil>. (MiniTest::Assertion)
	from /Users/headius/projects/webrick/test/lib/test/unit/assertions.rb:37:in `assert'
	from /Users/headius/projects/webrick/test/lib/test/unit/assertions.rb:298:in `assert_equal'
	from test/webrick/test_https.rb:43:in `https_get'
	from test/webrick/test_https.rb:94:in `block in test_sni'
	from /Users/headius/projects/webrick/test/webrick/utils.rb:67:in `block in start_server'

Note that the assertion here must be commented out in order to see this failure, due to #201: https://github.com/ruby/webrick/blob/2c912ded39f2d3046203cde8b169dcf2c267017e/test/webrick/test_https.rb#L90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant