Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50B94101E5 for ; Mon, 16 Feb 2015 15:17:12 +0000 (UTC) Received: (qmail 5630 invoked by uid 500); 16 Feb 2015 15:17:12 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 5567 invoked by uid 500); 16 Feb 2015 15:17:11 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 5552 invoked by uid 99); 16 Feb 2015 15:17:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Feb 2015 15:17:11 +0000 Date: Mon, 16 Feb 2015 15:17:11 +0000 (UTC) From: =?utf-8?Q?=C3=98yvind_Horneland_=28JIRA=29?= To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1613) DefaultHostNameVerifier fails matching wildcard in subject alt name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1613?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D14322857#comment-14322857 ]=20 =C3=98yvind Horneland commented on HTTPCLIENT-1613: ---------------------------------------------- Another reply with more details: #3 {quote} This was discussed here: https://bugzilla.mozilla.org/show_bug.cgi?id=3D687= 165 The result was to split the list in two: https://bugzilla.mozilla.org/show_= bug.cgi?id=3D712640 The corresponding change in Chrome land is: https://chromium.googlesource.com/chromium/src/+/d5dd7dd75af62a5dbbea7c= 671e034765621bdeec And then https://code.google.com/p/chromium/issues/detail?id=3D100442 I would suggest to contact Gerv from Mozilla on the acceptable use-cases. T= he reason googleapis.com was added to the list was the same as for appspot.= com and blogspot.com (subdomains in googleapis.com will be/are controllable= by users). {quote} > DefaultHostNameVerifier fails matching wildcard in subject alt name > ------------------------------------------------------------------- > > Key: HTTPCLIENT-1613 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-161= 3 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.4 Final > Reporter: =C3=98yvind Horneland > Labels: ssl > > Host: www.googleapis.com > Certificate subject alt name: *.googleapis.com > DefaultHostnameVerifier.matchDNSName throws an SSLException with message > {quote} > DefaultHostnameVerifier - Certificate for doesn't ma= tch any of the subject alternative names: [*.googleapis.com, *.clients6.goo= gle.com, *.cloudendpointsapis.com, cloudendpointsapis.com, googleapis.com] > {quote} > The default PublicSuffixMatcher is in use. > Possible cause:=20 > DefaultHostnameVerifier's matchDNSName > matchIdentityStrict > matchIdent= ity: > {noformat} > private static boolean matchIdentity(final String host, final String = identity, > final PublicSuffixMatcher public= SuffixMatcher, > final boolean strict) { > if (publicSuffixMatcher !=3D null && host.contains(".")) { > if (!matchDomainRoot(host, publicSuffixMatcher.getDomainRoot(= identity))) { > return false; // WILL EXIT THE WILDCARD CHECK HERE > } > } > // RFC 2818, 3.1. Server Identity > // "...Names may contain the wildcard > // character * which is considered to match any single domain nam= e > // component or component fragment..." > // Based on this statement presuming only singular wildcard is le= gal > final int asteriskIdx =3D identity.indexOf('*'); > {noformat} > The call to {{publicSuffixMatcher.getDomainRoot(identity)}} returns *.goo= gleapis.com, but this should probably return googleapis.com (without the wi= ldcard)? If the code reaches the "RFC 2818" logic, then it validates just f= ine. > Note: A default PublicSuffixMatcher is in use. > Stacktrace: > {noformat} > 10:37:35,319 DEBUG 27 4 DefaultHostnameVerifier - Certificate for doesn't match any of the subject alternative names: [*.google= apis.com, *.clients6.google.com, *.cloudendpointsapis.com, cloudendpointsap= is.com, googleapis.com] > javax.net.ssl.SSLException: Certificate for doesn't = match any of the subject alternative names: [*.googleapis.com, *.clients6.g= oogle.com, *.cloudendpointsapis.com, cloudendpointsapis.com, googleapis.com= ] > at org.apache.http.conn.ssl.DefaultHostnameVerifier.matchDNSName(Def= aultHostnameVerifier.java:157) > at org.apache.http.conn.ssl.DefaultHostnameVerifier.verify(DefaultHo= stnameVerifier.java:108) > at org.apache.http.conn.ssl.DefaultHostnameVerifier.verify(DefaultHo= stnameVerifier.java:86) > at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostnam= e(SSLConnectionSocketFactory.java:462) > at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayered= Socket(SSLConnectionSocketFactory.java:396) > at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket= (SSLConnectionSocketFactory.java:354) > at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.con= nect(DefaultHttpClientConnectionOperator.java:134) > at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.conn= ect(PoolingHttpClientConnectionManager.java:353) > at org.apache.http.impl.execchain.MainClientExec.establishRoute(Main= ClientExec.java:380) > at org.apache.http.impl.execchain.MainClientExec.execute(MainClientE= xec.java:236) > at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.= java:184) > at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:8= 8) > at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.= java:110) > at org.apache.http.impl.client.InternalHttpClient.doExecute(Internal= HttpClient.java:184) > at org.apache.http.impl.client.CloseableHttpClient.execute(Closeable= HttpClient.java:82) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org