Most visited

Recently visited

Added in API level 1
Deprecated since API level 22

StrictHostnameVerifier

public class StrictHostnameVerifier
extends AbstractVerifier

java.lang.Object
    org.apache.http.conn.ssl.AbstractVerifier
      org.apache.http.conn.ssl.StrictHostnameVerifier


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

Strict HostnameVerifier与Sun Java 1.4,Sun Java 5和Sun Java 6-rc的工作方式相同。 它也非常接近IE6。 此实现似乎符合RFC 2818处理通配符的要求。

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 one divergence from IE6 is how we only check the first CN. IE6 allows a match against any of the CNs present. We decided to follow in Sun Java 1.4's footsteps and only check the first CN. (If you need to check all the CN's, feel free to write your own implementation!).

A wildcard such as "*.foo.com" matches only subdomains in the same level, for example "a.foo.com". It does not match deeper subdomains such as "a.b.foo.com".

摘要(Summary)

Public constructors

StrictHostnameVerifier()

公共方法(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

StrictHostnameVerifier

Added in API level 1
StrictHostnameVerifier ()

公共方法(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!