Search in sources :

Example 6 with SSLConfig

use of org.apache.geode.internal.admin.SSLConfig in project geode by apache.

the class SSLConfigurationFactory method getSSLConfigForComponent.

@Deprecated
public static SSLConfig getSSLConfigForComponent(final boolean useSSL, final boolean needClientAuth, final String protocols, final String ciphers, final Properties gfsecurityProps, final String alias) {
    SSLConfig sslConfig = new SSLConfig();
    sslConfig.setAlias(alias);
    sslConfig.setCiphers(ciphers);
    sslConfig.setProtocols(protocols);
    sslConfig.setRequireAuth(needClientAuth);
    sslConfig.setEnabled(useSSL);
    sslConfig = getInstance().configureSSLPropertiesFromSystemProperties(sslConfig, gfsecurityProps);
    return sslConfig;
}
Also used : SSLConfig(org.apache.geode.internal.admin.SSLConfig)

Example 7 with SSLConfig

use of org.apache.geode.internal.admin.SSLConfig in project geode by apache.

the class SSLConfigurationFactory method createSSLConfig.

private SSLConfig createSSLConfig(final SecurableCommunicationChannel sslEnabledComponent) {
    SSLConfig sslConfig = new SSLConfig();
    sslConfig.setCiphers(getDistributionConfig().getSSLCiphers());
    sslConfig.setEnabled(determineIfSSLEnabledForSSLComponent(sslEnabledComponent));
    sslConfig.setKeystore(getDistributionConfig().getSSLKeyStore());
    sslConfig.setKeystorePassword(getDistributionConfig().getSSLKeyStorePassword());
    sslConfig.setKeystoreType(getDistributionConfig().getSSLKeyStoreType());
    sslConfig.setTruststore(getDistributionConfig().getSSLTrustStore());
    sslConfig.setTruststorePassword(getDistributionConfig().getSSLTrustStorePassword());
    sslConfig.setProtocols(getDistributionConfig().getSSLProtocols());
    sslConfig.setRequireAuth(getDistributionConfig().getSSLRequireAuthentication());
    sslConfig.setAlias(getDistributionConfig().getSSLDefaultAlias());
    return sslConfig;
}
Also used : SSLConfig(org.apache.geode.internal.admin.SSLConfig)

Example 8 with SSLConfig

use of org.apache.geode.internal.admin.SSLConfig in project geode by apache.

the class JmxManagerAdvisee method fillInProfile.

@Override
public void fillInProfile(Profile profile) {
    assert profile instanceof JmxManagerProfile;
    JmxManagerProfile jmxp = (JmxManagerProfile) profile;
    DistributionConfig dc = getSystem().getConfig();
    boolean jmxManager = dc.getJmxManager();
    String host = "";
    int port = 0;
    boolean ssl = false;
    boolean started = false;
    SystemManagementService service = (SystemManagementService) ManagementService.getExistingManagementService(this.cache);
    if (service != null) {
        jmxManager = service.isManagerCreated();
        started = service.isManager();
    }
    if (jmxManager) {
        port = dc.getJmxManagerPort();
        boolean usingJdkConfig = false;
        if (port == 0) {
            port = Integer.getInteger("com.sun.management.jmxremote.port", 0);
            if (port != 0) {
                usingJdkConfig = true;
                // the jdk default
                ssl = true;
                if (System.getProperty("com.sun.management.jmxremote.ssl") != null) {
                    ssl = Boolean.getBoolean("com.sun.management.jmxremote.ssl");
                }
            }
        }
        if (port != 0) {
            if (!usingJdkConfig) {
                SSLConfig jmxSSL = SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.JMX);
                ssl = jmxSSL.isEnabled();
                host = dc.getJmxManagerHostnameForClients();
                if (host == null || host.equals("")) {
                    host = dc.getJmxManagerBindAddress();
                }
            }
            if (host == null || host.equals("")) {
                try {
                    // fixes 46317
                    host = SocketCreator.getLocalHost().getHostAddress();
                } catch (UnknownHostException ex) {
                    host = "127.0.0.1";
                }
            }
        }
    }
    jmxp.setInfo(jmxManager, host, port, ssl, started);
    this.myMostRecentProfile = jmxp;
}
Also used : JmxManagerProfile(org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile) SSLConfig(org.apache.geode.internal.admin.SSLConfig) DistributionConfig(org.apache.geode.distributed.internal.DistributionConfig) UnknownHostException(java.net.UnknownHostException)

Aggregations

SSLConfig (org.apache.geode.internal.admin.SSLConfig)8 Properties (java.util.Properties)2 DistributionConfigImpl (org.apache.geode.distributed.internal.DistributionConfigImpl)2 MembershipTest (org.apache.geode.test.junit.categories.MembershipTest)2 UnitTest (org.apache.geode.test.junit.categories.UnitTest)2 Test (org.junit.Test)2 RestoreSystemProperties (org.junit.contrib.java.lang.system.RestoreSystemProperties)2 UnknownHostException (java.net.UnknownHostException)1 DistributionConfig (org.apache.geode.distributed.internal.DistributionConfig)1 SecurableCommunicationChannel (org.apache.geode.internal.security.SecurableCommunicationChannel)1 JmxManagerProfile (org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile)1 Server (org.eclipse.jetty.server.Server)1