Issue #14013 has been updated by MSP-Greg (Greg L).


Eric,

Thank you for looking at this, along with r60189.  It seems that the Appveyor mswin builds are still failing on TestNetHTTPS#test_certificate_verify_failure.

Since many contributors are not using (or familiar with) Windows, I created a GitHub repo [MSP-Greg/trunk_mingw_testing](https://github.com/MSP-Greg/trunk_mingw_testing).  It allows one to easily add patch files, then run tests against the latest mingw trunk build from ruby-loco.  Since it's using the trunk build, it only works with *.rb changes.

I haven't created a README yet, but one could fork it and easily test *.rb code changes.

Using it, I created a patch using r60189, and I also had the failure in TestNetHTTPS#test_certificate_verify_failure.  See [here](https://ci.appveyor.com/project/MSP-Greg/trunk-mingw-testing/build/1), log below:

```
ruby -v --disable-gems runner.rb -v -I./lib --show-skip net/http/test_https.rb
ruby 2.5.0dev (2017-10-16 trunk 60190) [x64-mingw32]
Run options: -v -I./lib --show-skip

# Running tests:
[1/8] TestNetHTTPS#test_certificate_verify_failure = 1.06 s
[2/8] TestNetHTTPS#test_get = 1.12 s
[3/8] TestNetHTTPS#test_identity_verify_failure = 0.07 s
[4/8] TestNetHTTPS#test_post = 1.12 s
[5/8] TestNetHTTPS#test_session_reuse = 3.30 s
[6/8] TestNetHTTPS#test_session_reuse_but_expire = 2.23 s
[7/8] TestNetHTTPS#test_timeout_during_SSL_handshake = 0.04 s
[8/8] TestNetHTTPS#test_verify_none = 1.14 s

  1) Failure:
TestNetHTTPS#test_certificate_verify_failure [C:/ruby/test/net/http/utils.rb:48]:
<[]> expected but was
<["[2017-10-16 13:59:08] ERROR Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. - SSL_accept\n" +
 "\tC:/ruby_trunk/lib/ruby/2.5.0/webrick/server.rb:301:in `accept_nonblock'\n" +
 "\tC:/ruby_trunk/lib/ruby/2.5.0/webrick/server.rb:301:in `block (2 levels) in start_thread'\n" +
 "\tC:/ruby_trunk/lib/ruby/2.5.0/webrick/utils.rb:263:in `timeout'\n" +
 "\tC:/ruby_trunk/lib/ruby/2.5.0/webrick/server.rb:297:in `block in start_thread'\n"]>.

Finished tests in 10.146761s, 0.7884 tests/s, 4.8291 assertions/s.
8 tests, 49 assertions, 1 failures, 0 errors, 0 skips
```

You're much more familiar with server code and sockets than I am, so if you could have another look at it, I'd appreciate it.  I'd be happy to test anything... 

----------------------------------------
Bug #14013: [PATCH] Webrick 60172 fix
https://bugs.ruby-lang.org/issues/14013#change-67270

* Author: MSP-Greg (Greg L)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-10-13 trunk 60176) [x64-mingw32]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
I was looking at the failure from 60172, and just tried changing some code.  Low and behold, it passed all tests.  But, since I'm not that familiar with 'nonblock' issues, I thought asking someone with more knowledge would be appropriate.

The patch also included a patch to [TestNetHTTPS.test_verify](https://github.com/ruby/ruby/blob/41910c0d0e989c368c6e08690df8171589e52f76/test/net/http/test_https.rb#L119_L128), which was bypassed (not skipped) based on an ENV setting.  I changed it to skip based on what I think is a sensible criteria.

I'm somewhat concerned about the test times under windows.  Since this is a 'ruby only' patch, maybe someone can test under OSX or *nix?

After the patch, I have the following test results:

```
E:\GitHub\ruby\test>ruby -v --disable-gems runner.rb -I./lib -v --show-skip net/http/test_https.rb
ruby 2.5.0dev (2017-10-13 trunk 60176) [x64-mingw32]
Run options: -I./lib -v --show-skip

# Running tests:

[1/9] TestNetHTTPS#test_certificate_verify_failure = 1.08 s
[2/9] TestNetHTTPS#test_get = 1.14 s
[3/9] TestNetHTTPS#test_identity_verify_failure = 0.08 s
[4/9] TestNetHTTPS#test_post = 1.13 s
[5/9] TestNetHTTPS#test_session_reuse = 3.29 s
[6/9] TestNetHTTPS#test_session_reuse_but_expire = 2.25 s
[7/9] TestNetHTTPS#test_timeout_during_SSL_handshake = 0.05 s
[8/9] TestNetHTTPS#test_verify = 0.76 s
[9/9] TestNetHTTPS#test_verify_none = 1.14 s
Finished tests in 10.919400s, 0.8242 tests/s, 4.9453 assertions/s.
9 tests, 54 assertions, 0 failures, 0 errors, 0 skips


E:\GitHub\ruby\test>ruby -v --disable-gems runner.rb -I./lib -v --show-skip webrick/test_ssl_server.rb
ruby 2.5.0dev (2017-10-13 trunk 60176) [x64-mingw32]
Run options: -I./lib -v --show-skip

# Running tests:

[1/3] TestWEBrickSSLServer#test_self_signed_cert_server = 0.14 s
[2/3] TestWEBrickSSLServer#test_self_signed_cert_server_with_string = 0.19 s
[3/3] TestWEBrickSSLServer#test_slow_connect = 0.30 s
Finished tests in 0.639600s, 4.6904 tests/s, 20.3252 assertions/s.
3 tests, 13 assertions, 0 failures, 0 errors, 0 skips
```

Thanks, Greg

---Files--------------------------------
webrick_60172_fix.patch (1.8 KB)
webrick_60172_fix.patch (1.81 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>