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:
Oleg Kalnichevski 2014-08-19 14:19:21 +00:00
parent 95c0f4857e
commit 79b1eae93b
4 changed files with 9 additions and 4 deletions

View File

@ -41,10 +41,12 @@ import org.apache.http.annotation.Immutable;
* (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains,
* including "a.b.foo.com".
*
*
* @since 4.0
*
* @deprecated (4.4) Use {@link org.apache.http.conn.ssl.DefaultHostnameVerifier}
*/
@Immutable
@Deprecated
public class BrowserCompatHostnameVerifier extends AbstractVerifier {
public static final BrowserCompatHostnameVerifier INSTANCE = new BrowserCompatHostnameVerifier();

View File

@ -123,7 +123,7 @@ import org.apache.http.util.TextUtils;
*
* @since 4.3
*/
@ThreadSafe
@ThreadSafe @SuppressWarnings("deprecation")
public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactory {
public static final String TLS = "TLS";
@ -146,7 +146,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor
* @since 4.4
*/
public static HostnameVerifier getDefaultHostnameVerifier() {
return BrowserCompatHostnameVerifier.INSTANCE;
return DefaultHostnameVerifier.INSTANCE;
}
/**

View File

@ -50,8 +50,11 @@ import org.apache.http.annotation.Immutable;
*
*
* @since 4.0
*
* @deprecated (4.4) Use {@link org.apache.http.conn.ssl.DefaultHostnameVerifier}
*/
@Immutable
@Deprecated
public class StrictHostnameVerifier extends AbstractVerifier {
public static final StrictHostnameVerifier INSTANCE = new StrictHostnameVerifier();

View File

@ -188,7 +188,7 @@ public class TestHostnameVerifier {
final InputStream in = new ByteArrayInputStream(CertificatesToPlayWith.X509_MULTIPLE_SUBJECT_ALT);
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",
x509.getSubjectDN().getName());