hostname = "cybervillainsCA";
response.setContentType("application/pkix-cert ");
}
// get the cert for the hostname
KeyStoreManager keyStoreManager = com.groupon.odo.bmp.Utils.getKeyStoreManager(hostname);
if (hostname.equals("cybervillainsCA")) {
// get the cybervillians cert from resources
File root = new File("seleniumSslSupport" + File.separator + hostname);
// return the root cert
Files.copy(new File(root.getAbsolutePath() + File.separator + hostname + ".cer").toPath(), response.getOutputStream());
response.flushBuffer();
} else {
// return the cert for the appropriate alias
response.getOutputStream().write(keyStoreManager.getCertificateByAlias(hostname).getEncoded());
response.flushBuffer();
}
}