Skip to content

Commit

Permalink
Merge pull request #2936 from ganmacs/suppress-warning-of-verify_host…
Browse files Browse the repository at this point in the history
…name

Suppress warning of verify_hostname
  • Loading branch information
ganmacs committed Apr 7, 2020
2 parents 9e287c7 + f7e45c6 commit 02f34e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/plugin_helper/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def socket_create_tls(
context.ciphers = ciphers
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
context.cert_store = cert_store
context.verify_hostname = true if verify_fqdn && fqdn && context.respond_to?(:verify_hostname=)
context.verify_hostname = verify_fqdn && fqdn
context.key = OpenSSL::PKey::read(File.read(private_key_path), private_key_passphrase) if private_key_path

if cert_path
Expand Down
2 changes: 1 addition & 1 deletion test/plugin_helper/test_http_server_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def start_https_request(addr, port, verify: true, cert_path: nil, selfsigned: tr
end

context.cert_store = cert_store
if !hostname && context.respond_to?(:verify_hostname=)
if !hostname
context.verify_hostname = false # In test code, using hostname to be connected is very difficult
end

Expand Down
2 changes: 1 addition & 1 deletion test/plugin_helper/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ def open_tls_session(addr, port, version: Fluent::TLS::DEFAULT_VERSION, verify:
end
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
context.cert_store = cert_store
if !hostname && context.respond_to?(:verify_hostname=)
if !hostname
context.verify_hostname = false # In test code, using hostname to be connected is very difficult
end
else
Expand Down

0 comments on commit 02f34e7

Please sign in to comment.