private void configureBuilder(DistributionConfig config,
      ClusterManagementServiceInfo cmsInfo) {
    setHost(cmsInfo.getHostName());
    setPort(cmsInfo.getHttpPort());

    // if user didn't pass in a username and the locator requires credentials, use the credentials
    // user used to create the client cache
    if (cmsInfo.isSecured() && getUsername() == null) {
      Properties securityProps = config.getSecurityProps();
      String username = securityProps.getProperty(AuthInitialize.SECURITY_USERNAME);
      String password = securityProps.getProperty(AuthInitialize.SECURITY_PASSWORD);
      if (StringUtils.isBlank(username)) {
        String message =
            "You will need to set the buildWithHostAddress username and password or specify security-username and security-password in the properties when starting this geode server/client.";
        throw new IllegalStateException(message);
      }
      setUsername(username);
      setPassword(password);
    }

    if (cmsInfo.isSSL()) {
      SSLConfig sslConfig = SSLConfigurationFactory.getSSLConfigForComponent(
          config, SecurableCommunicationChannel.WEB);
      if (!sslConfig.useDefaultSSLContext() && sslConfig.getTruststore() == null) {
        throw new IllegalStateException(
            "This server/client needs to have ssl-truststore or ssl-use-default-context specified in order to use cluster management service.");
      }

      setSslContext(SSLUtil.createAndConfigureSSLContext(sslConfig, false));
    }
  }
Concrete implementation of {@link ConnectionConfig} which can be used to derive most (if not all)
of the connection properties from an existing {@link Cache} or {@link ClientCache}.

@see ClusterManagementServiceBuilder
geode-core/src/main/java/org/apache/geode/management/internal/api/GeodeConnectionConfig.java