From b033996821594e4c470edeece89daa79f4548303 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Wed, 27 Mar 2019 10:42:45 -0700 Subject: [PATCH] auto populate enabled ciphersuites with supported ones --- src/java/com/wolfssl/provider/jsse/WolfSSLContext.java | 5 ++++- .../wolfssl/provider/jsse/test/WolfSSLServerSocketTest.java | 2 +- .../com/wolfssl/provider/jsse/test/WolfSSLSocketTest.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/com/wolfssl/provider/jsse/WolfSSLContext.java b/src/java/com/wolfssl/provider/jsse/WolfSSLContext.java index d826236..34c1ce0 100644 --- a/src/java/com/wolfssl/provider/jsse/WolfSSLContext.java +++ b/src/java/com/wolfssl/provider/jsse/WolfSSLContext.java @@ -101,7 +101,10 @@ public class WolfSSLContext extends SSLContextSpi { } catch (Exception e) { throw new IllegalArgumentException(e); - } + } + + /* auto-populate enabled ciphersuites with supported ones */ + params.setCipherSuites(WolfSSL.getCiphersIana()); } private void LoadTrustedRootCerts() { diff --git a/src/test/com/wolfssl/provider/jsse/test/WolfSSLServerSocketTest.java b/src/test/com/wolfssl/provider/jsse/test/WolfSSLServerSocketTest.java index 549797f..67f3d8d 100644 --- a/src/test/com/wolfssl/provider/jsse/test/WolfSSLServerSocketTest.java +++ b/src/test/com/wolfssl/provider/jsse/test/WolfSSLServerSocketTest.java @@ -167,7 +167,7 @@ public class WolfSSLServerSocketTest { s.close(); /* should be null since we haven't set them */ - if (cipherSuites != null) { + if (cipherSuites == null) { System.out.println("\t... failed"); fail("SSLServerSocket.getEnabledCipherSuites() failed"); } diff --git a/src/test/com/wolfssl/provider/jsse/test/WolfSSLSocketTest.java b/src/test/com/wolfssl/provider/jsse/test/WolfSSLSocketTest.java index 23be73f..54f853a 100644 --- a/src/test/com/wolfssl/provider/jsse/test/WolfSSLSocketTest.java +++ b/src/test/com/wolfssl/provider/jsse/test/WolfSSLSocketTest.java @@ -196,7 +196,7 @@ public class WolfSSLSocketTest { SSLSocket s = socks.get(i); String[] cipherSuites = s.getEnabledCipherSuites(); - if (cipherSuites != null) { + if (cipherSuites == null) { System.out.println("\t... failed"); fail("SSLSocket.getEnabledCipherSuites() failed"); }