Skip to content

Commit b1fc5d6

Browse files
committed
Verify hostname by default
This was disabled years ago while we were adding support for it, but it has been working for some time now. This patch re-enables hostname verification by default. This addresses CVE-2025-46551 and GHSA-72qj-48g4-5xgx. Users can work around this by applying this patch manually to their own jruby-openssl and jruby installs, or by re-enabling hostname verification with the following code early in application boot: ```ruby require 'openssl' OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:verify_hostname] = true ```
1 parent 97798e0 commit b1fc5d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/openssl/ssl.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SSLContext
2020
DEFAULT_PARAMS = { # :nodoc:
2121
:min_version => OpenSSL::SSL::TLS1_VERSION,
2222
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
23-
:verify_hostname => nil, # TODO => true needs JRuby support to call verify_certificate_identity
23+
:verify_hostname => true,
2424
:options => OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_COMPRESSION
2525
}
2626

0 commit comments

Comments
 (0)