Deprecated BrowserCompatHostnameVerifier and StrictHostnameVerifier in favor of DefaultHostnameVerifier
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1618870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
95c0f4857e
commit
79b1eae93b
|
@ -41,10 +41,12 @@ import org.apache.http.annotation.Immutable;
|
||||||
* (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains,
|
* (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains,
|
||||||
* including "a.b.foo.com".
|
* including "a.b.foo.com".
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
|
*
|
||||||
|
* @deprecated (4.4) Use {@link org.apache.http.conn.ssl.DefaultHostnameVerifier}
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@Deprecated
|
||||||
public class BrowserCompatHostnameVerifier extends AbstractVerifier {
|
public class BrowserCompatHostnameVerifier extends AbstractVerifier {
|
||||||
|
|
||||||
public static final BrowserCompatHostnameVerifier INSTANCE = new BrowserCompatHostnameVerifier();
|
public static final BrowserCompatHostnameVerifier INSTANCE = new BrowserCompatHostnameVerifier();
|
||||||
|
|
|
@ -123,7 +123,7 @@ import org.apache.http.util.TextUtils;
|
||||||
*
|
*
|
||||||
* @since 4.3
|
* @since 4.3
|
||||||
*/
|
*/
|
||||||
@ThreadSafe
|
@ThreadSafe @SuppressWarnings("deprecation")
|
||||||
public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactory {
|
public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactory {
|
||||||
|
|
||||||
public static final String TLS = "TLS";
|
public static final String TLS = "TLS";
|
||||||
|
@ -146,7 +146,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
|
||||||
* @since 4.4
|
* @since 4.4
|
||||||
*/
|
*/
|
||||||
public static HostnameVerifier getDefaultHostnameVerifier() {
|
public static HostnameVerifier getDefaultHostnameVerifier() {
|
||||||
return BrowserCompatHostnameVerifier.INSTANCE;
|
return DefaultHostnameVerifier.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -50,8 +50,11 @@ import org.apache.http.annotation.Immutable;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
|
*
|
||||||
|
* @deprecated (4.4) Use {@link org.apache.http.conn.ssl.DefaultHostnameVerifier}
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@Deprecated
|
||||||
public class StrictHostnameVerifier extends AbstractVerifier {
|
public class StrictHostnameVerifier extends AbstractVerifier {
|
||||||
|
|
||||||
public static final StrictHostnameVerifier INSTANCE = new StrictHostnameVerifier();
|
public static final StrictHostnameVerifier INSTANCE = new StrictHostnameVerifier();
|
||||||
|
|
|
@ -188,7 +188,7 @@ public class TestHostnameVerifier {
|
||||||
final InputStream in = new ByteArrayInputStream(CertificatesToPlayWith.X509_MULTIPLE_SUBJECT_ALT);
|
final InputStream in = new ByteArrayInputStream(CertificatesToPlayWith.X509_MULTIPLE_SUBJECT_ALT);
|
||||||
final X509Certificate x509 = (X509Certificate) cf.generateCertificate(in);
|
final X509Certificate x509 = (X509Certificate) cf.generateCertificate(in);
|
||||||
|
|
||||||
final X509HostnameVerifier verifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
|
final X509HostnameVerifier verifier = BrowserCompatHostnameVerifier.INSTANCE;
|
||||||
|
|
||||||
Assert.assertEquals("CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=CH",
|
Assert.assertEquals("CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=CH",
|
||||||
x509.getSubjectDN().getName());
|
x509.getSubjectDN().getName());
|
||||||
|
|
Loading…
Reference in New Issue