private int createLocator(VM memberVM, boolean usingOldVersion) {
    int port = usingOldVersion ? getRandomAvailableTCPPort() : 0;
    return memberVM.invoke("create locator", () -> {
      // if you need to debug SSL communications use this property:
      // System.setProperty("javax.net.debug", "all");
      System.setProperty(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY, "true");
      try {
        // for stress-tests make sure that an older-version locator doesn't try
        // to read state persisted by another run's newer-version locator
        if (usingOldVersion) {
          DistributedTestUtils.deleteLocatorStateFile(port);
        }
        Properties dsProperties = getDistributedSystemProperties();
        dsProperties.setProperty(HTTP_SERVICE_PORT, "0");
        return Locator.startLocatorAndDS(port, new File(""), dsProperties)
            .getPort();
      } finally {
        System.clearProperty(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY);
      }
    });
  }
This class tests cluster tcp/ip communications both with and without SSL enabled
geode-core/src/upgradeTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java