@Override
public void configure(Configuration configuration) throws ConfigurationException {
// get the configured security domain name.
String securityDomain = configuration.getAttribute(JacORBSubsystemConstants.SECURITY_SECURITY_DOMAIN);
if (securityDomain == null)
throw new ConfigurationException("Error configuring domain server socket factory: security domain is null");
// use the security domain name to obtain the JSSE security domain.
try {
InitialContext context = new InitialContext();
this.jsseSecurityDomain = (JSSESecurityDomain) context.lookup(SecurityConstants.JAAS_CONTEXT_ROOT +
securityDomain + "/jsse");
log.debugf("Obtained JSSE security domain with name %s", securityDomain);
} catch (NamingException ne) {
log.errorf("Failed to obtain JSSE security domain with name %s", securityDomain);
}
if (this.jsseSecurityDomain == null)
throw new ConfigurationException("Error configuring domain server socket factory: failed to lookup JSSE security domain");
// check if mutual auth is requested or required.
String optionName = PropertiesMap.JACORB_PROPS_MAP.get(JacORBSubsystemConstants.SECURITY_SERVER_SUPPORTS);
short serverSupportedOptions = Short.parseShort(configuration.getAttribute(optionName), 16); // value is hexadecimal.
optionName = PropertiesMap.JACORB_PROPS_MAP.get(JacORBSubsystemConstants.SECURITY_SERVER_REQUIRES);