Skip to content

Commit da097b8

Browse files
committed
exclude SSLv2 in reported METHODS (we're now all fine to close jruby/jruby#1874)
1 parent cb1fdf8 commit da097b8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/org/jruby/ext/openssl/SSLContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ public static void createSSLContext(final Ruby runtime, final RubyModule SSL) {
172172
final Set<String> methodKeys = SSL_VERSION_OSSL2JSSE.keySet();
173173
final RubyArray methods = runtime.newArray( methodKeys.size() );
174174
for ( final String method : methodKeys ) {
175+
if ( method.equals("SSLv2") || method.startsWith("SSLv2_") ) {
176+
continue; // do not report SSLv2, SSLv2_server, SSLv2_client
177+
}
175178
if ( method.indexOf('.') == -1 ) {
176179
// do not "officially" report TLSv1.1 and TLSv1.2
177180
methods.append( runtime.newSymbol(method) );

src/test/ruby/ssl/test_context.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ class TestSSLContext < TestCase
66

77
def test_methods
88
methods = OpenSSL::SSL::SSLContext::METHODS
9-
assert methods.include?(:'SSLv3')
9+
assert methods.include?(:SSLv3)
1010
assert methods.include?(:'TLSv1_1')
1111
assert ! methods.include?(:'TLSv1.1')
12+
13+
assert ! methods.include?(:SSLv2)
14+
assert ! methods.include?(:SSLv2_client)
1215
end
1316

1417
def test_context_new

0 commit comments

Comments
 (0)