private void copyClusterSSLPropsToGatewaySSLProps() {
    boolean gatewaySSLOverriden = sourceMap.get(GATEWAY_SSL_ENABLED) != null;
    boolean clusterSSLOverRidden = sourceMap.get(CLUSTER_SSL_ENABLED) != null;
    boolean hasSSLComponents = sourceMap.get(SSL_ENABLED_COMPONENTS) != null;

    if (clusterSSLOverRidden && !gatewaySSLOverriden && !hasSSLComponents) {
      gatewaySSLEnabled = clusterSSLEnabled;
      sourceMap.put(GATEWAY_SSL_ENABLED, sourceMap.get(CLUSTER_SSL_ENABLED));
      if (sourceMap.get(CLUSTER_SSL_CIPHERS) != null) {
        gatewaySslCiphers = clusterSSLCiphers;
        sourceMap.put(GATEWAY_SSL_CIPHERS, sourceMap.get(CLUSTER_SSL_CIPHERS));
      }

      if (sourceMap.get(CLUSTER_SSL_PROTOCOLS) != null) {
        gatewaySslProtocols = clusterSSLProtocols;
        sourceMap.put(GATEWAY_SSL_PROTOCOLS, sourceMap.get(CLUSTER_SSL_PROTOCOLS));
      }

      if (sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION) != null) {
        gatewaySslRequireAuthentication = clusterSSLRequireAuthentication;
        sourceMap.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION,
            sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION));
      }

      if (sourceMap.get(CLUSTER_SSL_KEYSTORE) != null) {
        gatewaySSLKeyStore = clusterSSLKeyStore;
        sourceMap.put(GATEWAY_SSL_KEYSTORE, sourceMap.get(CLUSTER_SSL_KEYSTORE));
      }
      if (sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE) != null) {
        gatewaySSLKeyStoreType = clusterSSLKeyStoreType;
        sourceMap.put(GATEWAY_SSL_KEYSTORE_TYPE,
            sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE));
      }
      if (sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD) != null) {
        gatewaySSLKeyStorePassword = clusterSSLKeyStorePassword;
        sourceMap.put(GATEWAY_SSL_KEYSTORE_PASSWORD,
            sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD));
      }
      if (sourceMap.get(CLUSTER_SSL_TRUSTSTORE) != null) {
        gatewaySSLTrustStore = clusterSSLTrustStore;
        sourceMap.put(GATEWAY_SSL_TRUSTSTORE, sourceMap.get(CLUSTER_SSL_TRUSTSTORE));
      }
      if (sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD) != null) {
        gatewaySSLTrustStorePassword = clusterSSLTrustStorePassword;
        sourceMap.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD,
            sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD));
      }
      gatewaySslProperties.putAll(clusterSSLProperties);
    }

    if (gatewaySSLOverriden) {
      if (sourceMap.get(GATEWAY_SSL_KEYSTORE) == null
          && sourceMap.get(CLUSTER_SSL_KEYSTORE) != null) {
        gatewaySSLKeyStore = clusterSSLKeyStore;
        sourceMap.put(GATEWAY_SSL_KEYSTORE, sourceMap.get(CLUSTER_SSL_KEYSTORE));
      }
      if (sourceMap.get(GATEWAY_SSL_KEYSTORE_TYPE) == null
          && sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE) != null) {
        gatewaySSLKeyStoreType = clusterSSLKeyStoreType;
        sourceMap.put(GATEWAY_SSL_KEYSTORE_TYPE,
            sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE));
      }
      if (sourceMap.get(GATEWAY_SSL_KEYSTORE_PASSWORD) == null
          && sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD) != null) {
        gatewaySSLKeyStorePassword = clusterSSLKeyStorePassword;
        sourceMap.put(GATEWAY_SSL_KEYSTORE_PASSWORD,
            sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD));
      }
      if (sourceMap.get(GATEWAY_SSL_TRUSTSTORE) == null
          && sourceMap.get(CLUSTER_SSL_TRUSTSTORE) != null) {
        gatewaySSLTrustStore = clusterSSLTrustStore;
        sourceMap.put(GATEWAY_SSL_TRUSTSTORE, sourceMap.get(CLUSTER_SSL_TRUSTSTORE));
      }
      if (sourceMap.get(GATEWAY_SSL_TRUSTSTORE_PASSWORD) == null
          && sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD) != null) {
        gatewaySSLTrustStorePassword = clusterSSLTrustStorePassword;
        sourceMap.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD,
            sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD));
      }
    }
  }
if gateway-ssl-enabled is false, then use the properties from cluster-ssl-* properties if
gateway-ssl-*properties are given then use them, and copy the unspecified gateway properties
from cluster-properties
geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfigImpl.java