1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/net/http
Jeremy Evans 7529c53891 [ruby/net-http] Do not set SNI hostname if connecting to IP address
RFC 6066, section 3, explicitly disallows the use of an IP address
as an SNI server name.  So check if the connection is being made
to an IP address using the resolv regexps, and do not set an SNI
hostname in that case.

Recent changes to LibreSSL make it more strictly follow RFC 6066,
resulting an s.hostname= raising an error if passed an IP address.
When such verions of LibreSSL are used, this change not only fixes
the net/http tests, it also fixes tests for webrick and open-uri,
which both make SSL connections to 127.0.0.1 using net/http in
their tests.

Avoid warning in the openssl extension by unsetting
@ssl_context.verify_hostname if connecting to an IP address.
Make changes so that the post_connection_check still happens
when connecting to an IP address, which is necessary to keep
checking that the certificate returned includes the IP address,
which one of the tests depends on.

Revert the previous change that modified the regexp used for
checking the error message.

https://github.com/ruby/net-http/commit/fa68e64bee
2022-02-03 05:10:21 +09:00
..
test_buffered_io.rb
test_http.rb [ruby/net-http] Reset keep_alive timer on new connection 2021-11-04 20:44:04 +09:00
test_http_request.rb Sync test_http_request.rb after fix to net-http 2021-11-15 09:31:44 -08:00
test_httpheader.rb
test_httpresponse.rb [ruby/net-http] Remove redundant MJIT condition 2022-01-17 17:11:27 +09:00
test_httpresponses.rb
test_https.rb [ruby/net-http] Do not set SNI hostname if connecting to IP address 2022-02-03 05:10:21 +09:00
test_https_proxy.rb [ruby/net-http] Use omit instead of skip for test-unit 2022-01-11 21:45:34 +09:00
utils.rb Let Net::HTTP.get take request headers (#2957) 2020-03-10 22:26:22 -07:00