"creating SSLContext: ERROR no such algorithm");
}
//Step 2: obtain a key store instance, type is fixed
KeyStore myKeys;
try
{
myKeys = KeyStore.getInstance(ConstsIf.KS_TYPE_JKS);
} catch (KeyStoreException e1)
{
throw new ConfigurationException(
"",
"creating SSLContext: ERROR no such algorithm");
}
InputStream is = null;
char[] keyPassPhrase = null;
if (!isDefaultConfig)
{
//Step 3:obtain password phrase for a keystore
try
{
keyPassPhrase = ((String) m_config.get(KEYSTOREPASS_KEY)).toCharArray();
} catch (Exception epass) {}
//Step 4:obtain input stream for a key store
// - if the config admin set it to type byte[], assume it is a keystore itself
// - else if it is of type string try to interpret this string as an (absolute) path
// to a file
// - else assume that this is a incomplete configruation we got from the CM Admin,
// use the default keystore
// from CM as byte[] ?
if ((keyPassPhrase != null) && (is == null))
{
try
{
is = new ByteArrayInputStream((byte[]) m_config.get(KEYSTORE_KEY));
} catch (Exception eb) {}
}
//from CM as a file pointer ?
if ((keyPassPhrase != null) && (is == null))
{
try
{
is = new FileInputStream((String) m_config.get(KEYSTORE_KEY));
} catch (Exception ef) {}
}
if ((is == null) && m_log.doWarn())
{
m_log.warn("using default, config is invalid: " + m_config.get("service.pid"));
}
}
// Step 3 & 4 executed now if config is bad or we just use the default config
if (is == null)
{
try
{
keyPassPhrase = DEFAULT_PASSPHR_VALUE.toCharArray();
is = getClass().getResourceAsStream(DEFAULT_KEYSTORE_VALUE);
} catch (Exception edef)
{
}
}
// Step 5: load keys into keystore
try
{
myKeys.load(is, keyPassPhrase);
} catch (Exception eload)
{
throw new ConfigurationException(
KEYSTORE_KEY + "," + KEYSTOREPASS_KEY,