MCPcopy Create free account
hub / github.com/apache/tomcat / testKeyPass

Method testKeyPass

test/org/apache/tomcat/util/net/TestSsl.java:252–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 }
251
252 @Test
253 public void testKeyPass() throws Exception {
254 TesterSupport.configureClientSsl();
255
256 Tomcat tomcat = getTomcatInstance();
257
258 File appDir = new File(getBuildDirectory(), "webapps/examples");
259 Context ctxt = tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
260 ctxt.addApplicationListener(WsContextListener.class.getName());
261
262 TesterSupport.initSsl(tomcat, TesterSupport.LOCALHOST_KEYPASS_JKS, false,
263 TesterSupport.JKS_PASS, null, TesterSupport.JKS_KEY_PASS, null);
264
265 TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL);
266
267 tomcat.start();
268 ByteChunk res = getUrl("https://localhost:" + getPort() +
269 "/examples/servlets/servlet/HelloWorldExample");
270 Assert.assertTrue(res.toString().indexOf("<a href=\"../helloworld.html\">") > 0);
271 Assert.assertTrue("Checking no client issuer has been requested",
272 TesterSupport.getLastClientAuthRequestedIssuerCount() == 0);
273 }
274
275 @Test
276 public void testKeyPassFile() throws Exception {

Callers

nothing calls this directly

Calls 15

configureClientSslMethod · 0.95
addWebappMethod · 0.95
initSslMethod · 0.95
startMethod · 0.95
toStringMethod · 0.95
getTomcatInstanceMethod · 0.80
getBuildDirectoryMethod · 0.80
getNameMethod · 0.65
getUrlMethod · 0.65

Tested by

no test coverage detected