code: private HostnameVerifier getHostnameVerifier() {
          return new HostnameVerifier() {
  
              @Override
              public boolean verify(String hostName, SSLSession arg1) {
                  for (Pattern trustedHostPattern : trustedHostPatterns) {
                      if (trustedHostPattern.matcher(hostName).matches()) {
                          return true;
                      }
                  }
                  return false;
              }
          };
      }
docs: This host name verifier is used if the protocol is HTTPS AND a trusted hosts list has been provided. Otherwise,
  the default behavior is used (requiring valid, unexpired certificates).
  
  @return A host-name verifier that verifies the hosts based on the trusted hosts list. Note, the trusted hosts
  list can include wild-card characters * and +.