mirror of https://github.com/apache/activemq.git
AMQ-8048 replace SslContextFactory with SslContextFactory$Server & fix assembly BrokerXmlConfigStartTest activemq-security.xml test
This commit is contained in:
parent
2f40261362
commit
86eda3a6b1
|
@ -143,19 +143,19 @@
|
||||||
<property name="port" value="#{systemProperties['jetty.port']}" />
|
<property name="port" value="#{systemProperties['jetty.port']}" />
|
||||||
</bean>
|
</bean>
|
||||||
<!--
|
<!--
|
||||||
Enable this connector if you wish to use https with web console
|
Enable this connector to use https with web console
|
||||||
-->
|
-->
|
||||||
<!-- bean id="SecureConnector" class="org.eclipse.jetty.server.ServerConnector">
|
<bean id="SecureConnector" class="org.eclipse.jetty.server.ServerConnector">
|
||||||
<constructor-arg ref="Server" />
|
<constructor-arg ref="Server" />
|
||||||
<constructor-arg>
|
<constructor-arg>
|
||||||
<bean id="handlers" class="org.eclipse.jetty.util.ssl.SslContextFactory">
|
<bean id="handlers" class="org.eclipse.jetty.util.ssl.SslContextFactory$Server">
|
||||||
|
|
||||||
<property name="keyStorePath" value="${activemq.conf}/broker.ks" />
|
<property name="keyStorePath" value="${activemq.conf}/broker.ks" />
|
||||||
<property name="keyStorePassword" value="password" />
|
<property name="keyStorePassword" value="password" />
|
||||||
</bean>
|
</bean>
|
||||||
</constructor-arg>
|
</constructor-arg>
|
||||||
<property name="port" value="8162" />
|
<property name="port" value="8162" />
|
||||||
</bean -->
|
</bean>
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
|
@ -20,10 +20,12 @@ import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
@ -142,10 +144,24 @@ public class BrokerXmlConfigStartTest {
|
||||||
System.setProperty("activemq.conf", "target/conf");
|
System.setProperty("activemq.conf", "target/conf");
|
||||||
secProps = new Properties();
|
secProps = new Properties();
|
||||||
secProps.load(new FileInputStream(new File("target/conf/credentials.properties")));
|
secProps.load(new FileInputStream(new File("target/conf/credentials.properties")));
|
||||||
|
setEnv("ACTIVEMQ_ENCRYPTION_PASSWORD", "activemq");
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
TimeUnit.SECONDS.sleep(1);
|
TimeUnit.SECONDS.sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setEnv(String key, String value) {
|
||||||
|
try {
|
||||||
|
Map<String, String> env = System.getenv();
|
||||||
|
Class<?> cl = env.getClass();
|
||||||
|
Field field = cl.getDeclaredField("m");
|
||||||
|
field.setAccessible(true);
|
||||||
|
Map<String, String> writableEnv = (Map<String, String>) field.get(env);
|
||||||
|
writableEnv.put(key, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalStateException("Failed to set environment variable", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue