Commit 72dd75b6 authored by sopov.ivan's avatar sopov.ivan Committed by Phillip Webb

Add Jetty SSL keystore in classpath test

Update JettyEmbeddedServletContainerFactoryTests to test loading an
SSL keystore from the classpath. Currently this is a Jetty only feature,
although if https://issues.apache.org/bugzilla/show_bug.cgi?id=56777 is
fixed we could do the same thing with Tomcat.

Closes gh-1943
parent 6efa2d53
......@@ -312,6 +312,10 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
@Test
public void basicSsl() throws Exception {
testBasicSllWithKeystore("src/test/resources/test.jks");
}
protected final void testBasicSllWithKeystore(String keyStore) throws Exception {
FileCopyUtils.copy("test",
new FileWriter(this.temporaryFolder.newFile("test.txt")));
......@@ -319,7 +323,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
factory.setDocumentRoot(this.temporaryFolder.getRoot());
Ssl ssl = new Ssl();
ssl.setKeyStore("src/test/resources/test.jks");
ssl.setKeyStore(keyStore);
ssl.setKeyStorePassword("secret");
ssl.setKeyPassword("password");
factory.setSsl(ssl);
......
......@@ -154,4 +154,9 @@ public class JettyEmbeddedServletContainerFactoryTests extends
assertThat(getResponse(getLocalUrl("/hello")), equalTo("Hello World"));
}
@Test
public void basicSslClasspathKeyStore() throws Exception {
testBasicSllWithKeystore("classpath:test.jks");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment