@Before
  public void setUp() throws Exception {

    SocketCreatorFactory.close(); // to clear socket creators made in previous tests

    IgnoredException.addIgnoredException("javax.net.ssl.SSLException: Read timed out");

    localHost = InetAddress.getLoopbackAddress();

    CertificateMaterial ca = new CertificateBuilder()
        .commonName("Test CA")
        .isCA()
        .generate();

    CertStores certStores = CertStores.locatorStore();
    certStores.trust("ca", ca);

    CertificateBuilder certBuilder = new CertificateBuilder()
        .commonName("iAmTheServer")
        .issuedBy(ca);

    if (addCertificateSAN) {
      certBuilder.sanDnsName(localHost.getHostName());
    }

    CertificateMaterial locatorCert = certBuilder.generate();
    certStores.withCertificate("locator", locatorCert);

    DistributionConfig distributionConfig = new DistributionConfigImpl(
        certStores.propertiesWith("cluster", false, doEndPointIdentification));

    SocketCreatorFactory.setDistributionConfig(distributionConfig);
    socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(CLUSTER);
  }
Integration tests for SSL handshake specifically focusing on hostname validation.
geode-core/src/integrationTest/java/org/apache/geode/internal/net/SSLSocketHostNameVerificationIntegrationTest.java