Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6d3eba1d3c4e
Choose a base ref
...
head repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c3ac283be8b6
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Aug 27, 2015

  1. add TLSv1_1_client, TLSv1_1_server, TLSv1_2_client and TLSv1_2_server…

    … options to ssl_version
    cheister authored and kares committed Aug 27, 2015
    Copy the full SHA
    34aaa64 View commit details
  2. Copy the full SHA
    c3ac283 View commit details
Showing with 14 additions and 0 deletions.
  1. +7 −0 src/main/java/org/jruby/ext/openssl/SSLContext.java
  2. +7 −0 src/test/ruby/ssl/test_context.rb
7 changes: 7 additions & 0 deletions src/main/java/org/jruby/ext/openssl/SSLContext.java
Original file line number Diff line number Diff line change
@@ -136,13 +136,17 @@ public class SSLContext extends RubyObject {
ENABLED_PROTOCOLS.put("TLS", new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" });

SSL_VERSION_OSSL2JSSE.put("TLSv1.1", "TLSv1.1");
SSL_VERSION_OSSL2JSSE.put("TLSv1_1_server", "TLSv1.1");
SSL_VERSION_OSSL2JSSE.put("TLSv1_1_client", "TLSv1.1");
ENABLED_PROTOCOLS.put("TLSv1.1", new String[] { "TLSv1.1" });

SSL_VERSION_OSSL2JSSE.put("TLSv1_1", "TLSv1.1"); // supported on MRI 2.x
SSL_VERSION_OSSL2JSSE.put("TLSv1_2", "TLSv1.2"); // supported on MRI 2.x
ENABLED_PROTOCOLS.put("TLSv1.2", new String[] { "TLSv1.2" });

SSL_VERSION_OSSL2JSSE.put("TLSv1.2", "TLSv1.2"); // just for completeness
SSL_VERSION_OSSL2JSSE.put("TLSv1_2_server", "TLSv1.2");
SSL_VERSION_OSSL2JSSE.put("TLSv1_2_client", "TLSv1.2");
}

private static ObjectAllocator SSLCONTEXT_ALLOCATOR = new ObjectAllocator() {
@@ -191,6 +195,9 @@ public static void createSSLContext(final Ruby runtime, final RubyModule SSL) {
SSLContext.defineConstant("METHODS", methods);
// in 1.8.7 as well as 1.9.3 :
// [:TLSv1, :TLSv1_server, :TLSv1_client, :SSLv3, :SSLv3_server, :SSLv3_client, :SSLv23, :SSLv23_server, :SSLv23_client]
// in 2.0.0 :
// [:TLSv1, :TLSv1_server, :TLSv1_client, :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client, :TLSv1_1, :TLSv1_1_server,
// :TLSv1_1_client, :SSLv3, :SSLv3_server, :SSLv3_client, :SSLv23, :SSLv23_server, :SSLv23_client]

SSLContext.setConstant("SESSION_CACHE_OFF", runtime.newFixnum(SESSION_CACHE_OFF));
SSLContext.setConstant("SESSION_CACHE_CLIENT", runtime.newFixnum(SESSION_CACHE_CLIENT));
7 changes: 7 additions & 0 deletions src/test/ruby/ssl/test_context.rb
Original file line number Diff line number Diff line change
@@ -12,6 +12,13 @@ def test_methods

assert ! methods.include?(:SSLv2)
assert ! methods.include?(:SSLv2_client)

assert methods.include?(:'TLSv1_1_client')
assert methods.include?(:'TLSv1_1_server')

assert methods.include?(:'TLSv1_2')
assert methods.include?(:'TLSv1_2_client')
assert methods.include?(:'TLSv1_2_server')
end

def test_context_new