InMemoryX509TrustManager mgr = null;
try {
String instanceRoot = System.getProperty(
SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
String serverName = System.getProperty(
SystemPropertyConstants.SERVER_NAME);
System.setProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY,
System.getProperty(SystemPropertyConstants.AGENT_ROOT_PROPERTY));
System.setProperty(SystemPropertyConstants.SERVER_NAME,
System.getProperty(SystemPropertyConstants.AGENT_NAME_PROPERTY));
mgr = new InMemoryX509TrustManager(mCertNickname);
System.setProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY, instanceRoot);
System.setProperty(SystemPropertyConstants.SERVER_NAME, serverName);
} catch (Throwable t) {
t.printStackTrace();
}
return new TrustManager[] {mgr};