Skip to content

Commit 07faba2

Browse files
committed
Fixup verify_hostname for ssl contexts
1 parent 0d64a9b commit 07faba2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/kafka/ssl_context.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ def self.build(ca_cert_file_path: nil, ca_cert: nil, client_cert: nil, client_ce
5454
store.set_default_paths
5555
end
5656
ssl_context.cert_store = store
57-
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
58-
# Verify certificate hostname if supported (ruby >= 2.4.0)
59-
ssl_context.verify_hostname = verify_hostname if ssl_context.respond_to?(:verify_hostname=)
6057
end
6158

59+
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
60+
# Verify certificate hostname if supported (ruby >= 2.4.0)
61+
ssl_context.verify_hostname = verify_hostname if ssl_context.respond_to?(:verify_hostname=)
62+
6263
ssl_context
6364
end
6465
end

0 commit comments

Comments
 (0)