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 5C01318C8C for ; Mon, 23 Nov 2015 17:14:16 +0000 (UTC) Received: (qmail 61123 invoked by uid 500); 23 Nov 2015 17:14:11 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 61072 invoked by uid 500); 23 Nov 2015 17:14: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 61042 invoked by uid 99); 23 Nov 2015 17:14:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2015 17:14:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0924F2C1F57 for ; Mon, 23 Nov 2015 17:14:11 +0000 (UTC) Date: Mon, 23 Nov 2015 17:14:11 +0000 (UTC) From: "Jilles van Gurp (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1613) Support for so called 'private' domains in Mozilla Public Suffix List 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= =3D15022492#comment-15022492 ]=20 Jilles van Gurp commented on HTTPCLIENT-1613: --------------------------------------------- This just started failing for us again using httpclient 4.5.1. I added a va= riation of the workaround outlined above, which fixed it. Registry registry =3D RegistryBuilder.create() .register("http", PlainConnectionSocketFactory.getSocketFactory= ()) .register("https", new SSLConnectionSocketFactory(SSLContexts.c= reateDefault(), (hostname,session) -> { if(hostname.endsWith("googleapis.com")) { // workaround for https://issues.apache.org/jira/browse= /HTTPCLIENT-1613 and googleapis.com // works around an issue with the google certificate th= at google should be fixing // skip host name verification if the host is googleapi= s.com return true; } else { return defaultHostnameVerifier.verify(hostname, session= ); } })) .build(); connectionManager =3D new PoolingHttpClientConnectionManager(regist= ry); > Support for so called 'private' domains in Mozilla Public Suffix List > --------------------------------------------------------------------- > > Key: HTTPCLIENT-1613 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-161= 3 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient > Affects Versions: 4.4 Final > Reporter: =C3=98yvind Horneland > Assignee: Oleg Kalnichevski > Labels: ssl > Fix For: 4.5 > > > 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