code: private void verifyHostname(X509Certificate cer) {
          try {
              hostnameVerifier.verify(expectedCertCommonName, cer);
          } catch (SSLException e) {
              throw new SdkClientException("Certificate does not match expected common name: " + expectedCertCommonName, e);
          }
      }
docs: Verifies the hostname in the certificate matches {@link #expectedCertCommonName}.
  
  @param cer Certificate to validate.