String s = config.getProperty(PROPERTIES_TRUSTSTORE); if (s != null) { System.setProperty("javax.net.ssl.truststore", s); s = config.getProperty(PROPERTIES_TRUSTSTORE_PASSWORD); if (s != null) System.setProperty("javax.net.ssl.truststorepassword", s);
final Element securityElement = config.getChild("Security"); if (securityElement != null) {   final Element trustStoreElement = securityElement.getChild("Truststore"); if (trustStoreElement != null) {   String value = trustStoreElement.getAttributeValue("filename"); if (value == null) throw new DirectoryManagerConfigurationException("Attribute \"filename\" not found in Truststore element"); System.setProperty("javax.net.ssl.truststore", value);   value = trustStoreElement.getAttributeValue("password"); if (value == null) throw new DirectoryManagerConfigurationException("Attribute \"password\" not found in Truststore element"); System.setProperty("javax.net.ssl.truststorepassword", value);  }
    public synchronized void setConfig(final Properties config) {        // Sanity check.        if (config == null)            throw new IllegalArgumentException("Configuration cannot be NULL");        // Did we already set the one-time configuration?        if (initialized)            return;                // TODO: Add support for javax.net.ssl.keystore(password).        // Get and verify some properties.        String s = config.getProperty(PROPERTIES_TRUSTSTORE);        if (s != null) {            System.setProperty("javax.net.ssl.truststore", s);            s = config.getProperty(PROPERTIES_TRUSTSTORE_PASSWORD);            if (s != null)                System.setProperty("javax.net.ssl.truststorepassword", s);        }        // Wrap up.        Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());        initialized = true;    }