Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-07-22 23:36:19 +0000
committerGreg Wilkins2015-07-22 23:36:19 +0000
commit085ec933c5fce3e2e8d8a3f83b1b083fce9d0020 (patch)
tree2be01b280c9c2cd19b59e22587ec43288071f4ca
parent830b126e43db392f69f23c1dc69fe7f6fec86e33 (diff)
downloadorg.eclipse.jetty.project-085ec933c5fce3e2e8d8a3f83b1b083fce9d0020.tar.gz
org.eclipse.jetty.project-085ec933c5fce3e2e8d8a3f83b1b083fce9d0020.tar.xz
org.eclipse.jetty.project-085ec933c5fce3e2e8d8a3f83b1b083fce9d0020.zip
473294 - Fixed include cipher suites support for wildcards
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java9
-rw-r--r--jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java8
2 files changed, 11 insertions, 6 deletions
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
index f448f43d7f..6f982352f8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
@@ -1247,19 +1247,22 @@ public class SslContextFactory extends AbstractLifeCycle
protected void processIncludeCipherSuites(String[] supportedCipherSuites, List<String> selected_ciphers)
{
- ciphers: for (String cipherSuite : _includeCipherSuites)
+ for (String cipherSuite : _includeCipherSuites)
{
Pattern p = Pattern.compile(cipherSuite);
+ boolean added=false;
for (String supportedCipherSuite : supportedCipherSuites)
{
Matcher m = p.matcher(supportedCipherSuite);
if (m.matches())
{
+ added=true;
selected_ciphers.add(supportedCipherSuite);
- continue ciphers;
}
+
}
- LOG.info("Cipher {} not supported",cipherSuite);
+ if (!added)
+ LOG.info("No Cipher matching '{}' is supported",cipherSuite);
}
}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
index 4cd305eed2..35bc573854 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
@@ -28,6 +28,7 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore;
+import java.util.Arrays;
import javax.net.ssl.SSLEngine;
@@ -204,13 +205,14 @@ public class SslContextFactoryTest
@Test
public void testSetIncludeCipherSuitesRegex() throws Exception
{
- cf.setIncludeCipherSuites(".*RC4.*");
+ Log.getLogger(SslContextFactory.class).setDebugEnabled(true);
+ cf.setIncludeCipherSuites(".*ECDHE.*",".*WIBBLE.*");
cf.start();
SSLEngine sslEngine = cf.newSSLEngine();
String[] enabledCipherSuites = sslEngine.getEnabledCipherSuites();
- assertThat("At least 1 cipherSuite is enabled", enabledCipherSuites.length, greaterThan(0));
+ assertThat("At least 1 cipherSuite is enabled", enabledCipherSuites.length, greaterThan(1));
for (String enabledCipherSuite : enabledCipherSuites)
- assertThat("CipherSuite contains RC4", enabledCipherSuite.contains("RC4"), is(true));
+ assertThat("CipherSuite contains ECDHE", enabledCipherSuite.contains("ECDHE"), is(true));
}
@Test

Back to the top