diff options
author | TOMITA Masahiro <tommy@tmtm.org> | 2020-07-15 00:50:16 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-14 17:22:35 +0900 |
commit | 888e04ae05eb864756a43624888468617e39dd76 (patch) | |
tree | e8e5ac4c0555609348403ecfb89d55eda672717e /test/net/smtp | |
parent | cdb85142f9a0f2735ddb7544b5460809347a147a (diff) | |
download | ruby-888e04ae05eb864756a43624888468617e39dd76.tar.gz |
[ruby/net-smtp] TLS should not check the host name by default.
In tlsconnect(), the host name is checked when
@ssl_context.verify_mode is not OpenSSL::SSL::VERIFY_NONE, but the
verify_mode of @ssl_context generated by default is nil.
https://github.com/ruby/net-smtp/commit/bde75a15b5
Diffstat (limited to 'test/net/smtp')
-rw-r--r-- | test/net/smtp/test_ssl_socket.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/net/smtp/test_ssl_socket.rb b/test/net/smtp/test_ssl_socket.rb index 342391f159..dd9529f25e 100644 --- a/test/net/smtp/test_ssl_socket.rb +++ b/test/net/smtp/test_ssl_socket.rb @@ -53,8 +53,10 @@ module Net end } + ssl_context = OpenSSL::SSL::SSLContext.new + ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER connection = MySMTP.new('localhost', 25) - connection.enable_starttls_auto + connection.enable_starttls_auto(ssl_context) connection.fake_tcp = tcp_socket connection.fake_ssl = ssl_socket |