FELIX-4979 : [Jetty] String array properties are not parsed correctly when supplied through framework properties. Apply patch from Adrien Pailhes
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1693389 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
index 6bec280..a6ec0f0 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
@@ -551,7 +551,7 @@
final String stringVal = ((String) value).trim();
if (stringVal.length() > 0)
{
- return new String[] { stringVal };
+ return stringVal.split(",");
}
}
else if (value instanceof String[])
diff --git a/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java b/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
index 6b394b7..0d5cf9b 100644
--- a/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
+++ b/http/jetty/src/test/java/org/apache/felix/http/jetty/internal/JettyConfigTest.java
@@ -18,6 +18,7 @@
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertArrayEquals;
import java.util.Hashtable;
@@ -113,6 +114,15 @@
assertTrue(this.config.getHttpsPort() == port);
}
+ public void testParseStringArrayProperty() {
+ Hashtable<String, Object> props = new Hashtable<>();
+ props.put("org.apache.felix.https.jetty.ciphersuites.excluded",
+ "TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_anon_WITH_RC4_128_SHA");
+ this.config.update(props);
+ String[] expecteds = {"TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDH_anon_WITH_RC4_128_SHA"};
+ assertArrayEquals(expecteds, this.config.getExcludedCipherSuites());
+ }
+
@Override
protected void setUp()
{
@@ -120,4 +130,4 @@
replay(this.context);
this.config = new JettyConfig(this.context);
}
-}
\ No newline at end of file
+}