Most visited

Recently visited

Added in API level 1
Deprecated since API level 22

BrowserCompatHostnameVerifier

public class BrowserCompatHostnameVerifier
extends AbstractVerifier

java.lang.Object
   ↳ org.apache.http.conn.ssl.AbstractVerifier
     ↳ org.apache.http.conn.ssl.BrowserCompatHostnameVerifier


这个类在API级别22已被弃用。
请改用openConnection() 请访问this webpage了解更多详情。

HostnameVerifier的工作方式与Curl和Firefox相同。

The hostname must match either the first CN, or any of the subject-alts. A wildcard can occur in the CN, and in any of the subject-alts.

The only difference between BROWSER_COMPATIBLE and STRICT is that a wildcard (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains, including "a.b.foo.com".

Summary

Public constructors

BrowserCompatHostnameVerifier()

Public methods

final String toString()

返回对象的字符串表示形式。

final void verify(String host, String[] cns, String[] subjectAlts)

Inherited methods

From class org.apache.http.conn.ssl.AbstractVerifier
From class java.lang.Object
From interface org.apache.http.conn.ssl.X509HostnameVerifier
From interface javax.net.ssl.HostnameVerifier

Public constructors

BrowserCompatHostnameVerifier

Added in API level 1
BrowserCompatHostnameVerifier ()

Public methods

toString

Added in API level 1
String toString ()

返回对象的字符串表示形式。 通常, toString方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。

ObjecttoString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

verify

Added in API level 1
void verify (String host, 
                String[] cns, 
                String[] subjectAlts)

Parameters
host String
cns String
subjectAlts String
Throws
SSLException

Hooray!