Code example for HostnameVerifier

Methods: verify

0
        + "3g5kkio6IED47OP6wYnlmZ7EKP9cqjWwlnvHnnUcZ2SscoLNYs9rN9ccp8tuq2by\n" 
        + "88OyhKwGjJfhOudqfTNZcDzRHx4Fzm7UsVaycVw4uDmhEHJrAsmMPpj/+XRK9/42\n" 
        + "2xq+8bc6HojdtbCyug/fvBZvZqQXSmU8m8IVcMmWMz0ZQO8ee3QkBHMZfCy7P/kr\n" 
        + "VbWx/uETImUu+NZg22ewEw==\n" 
        + "-----END CERTIFICATE-----\n"); 
    assertFalse(verifier.verify("foo.com", session));
    assertFalse(verifier.verify("a.foo.com", session));
    assertTrue(verifier.verify("bar.com", session));
    assertFalse(verifier.verify("a.bar.com", session));
  } 
 
  /** 
   * Ignored due to incompatibilities between Android and Java on how non-ASCII 
   * subject alt names are parsed. Android fails to parse these, which means we 
   * fall back to the CN. The RI does parse them, so the CN is unused. 
   */ 
  @Test @Ignore public void verifyNonAsciiSubjectAlt() throws Exception { 
    // CN=foo.com, subjectAlt=bar.com, subjectAlt=花子.co.jp 
    // (hanako.co.jp in kanji) 
    SSLSession session = session(""
        + "-----BEGIN CERTIFICATE-----\n"