HTTPCLIENT-617: Hostname verification: turn off wildcards when CN is an IP address
Contributed by Julius Davies <juliusdavies at gmail.com> Reviewed by Oleg Kalnichevski git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@583749 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3e8a5f6863
commit
19e029924f
|
@ -31,6 +31,8 @@
|
|||
|
||||
package org.apache.http.conn.ssl;
|
||||
|
||||
import org.apache.http.conn.util.InetAddressUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.cert.Certificate;
|
||||
|
@ -195,7 +197,8 @@ public abstract class AbstractVerifier implements HostnameVerifier {
|
|||
// [*.org.uk], etc...
|
||||
boolean doWildcard = cn.startsWith("*.") &&
|
||||
cn.lastIndexOf('.') >= 0 &&
|
||||
acceptableCountryWildcard(cn);
|
||||
acceptableCountryWildcard(cn) &&
|
||||
!InetAddressUtils.isIPv4Address(host);
|
||||
|
||||
if(doWildcard) {
|
||||
match = hostName.endsWith(cn.substring(1));
|
||||
|
|
Loading…
Reference in New Issue