Code example for HostnameVerifier

Methods: verify

0
        + "1cxNfGxxechgF8HX10QV4dkyzp6Z1cfwvCeMrT5G/V1pejago0ayXx+GPLbWlNeZ\n" 
        + "S+Kl0m3p+QplXujtwG5fYcIpaGpiYraBLx3Tadih39QN65CnAh/zRDhLCUzKyt9l\n" 
        + "UGPLEUDzRHMPHLnSqT1n5UU5UDRytbjJPXzF+l/+WZIsanefWLsxnkgAuZe/oMMF\n" 
        + "EJMryEzOjg4Tfuc5qM0EXoPcQ/JlheaxZ40p2IyHqbsWV4MRYuFH4bkM\n" 
        + "-----END CERTIFICATE-----\n"); 
    assertTrue(verifier.verify("foo.co.jp", session));
    assertTrue(verifier.verify("\u82b1\u5b50.co.jp", 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 testWilcardNonAsciiSubjectAlt() throws Exception { 
    // CN=*.foo.com, subjectAlt=*.bar.com, subjectAlt=*.花子.co.jp 
    // (*.hanako.co.jp in kanji) 
    SSLSession session = session(""
        + "-----BEGIN CERTIFICATE-----\n" 
        + "MIIEcDCCA1igAwIBAgIJAIz+EYMBU6aWMA0GCSqGSIb3DQEBBQUAMIGiMQswCQYD\n" 
        + "VQQGEwJDQTELMAkGA1UECBMCQkMxEjAQBgNVBAcTCVZhbmNvdXZlcjEWMBQGA1UE\n"