Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 72210200B9D for ; Thu, 13 Oct 2016 13:30:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 709C9160AE4; Thu, 13 Oct 2016 11:30:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B0DDD160AE3 for ; Thu, 13 Oct 2016 13:30:22 +0200 (CEST) Received: (qmail 82159 invoked by uid 500); 13 Oct 2016 11:30:21 -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 82129 invoked by uid 99); 13 Oct 2016 11:30:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2016 11:30:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 82FD52C4C74 for ; Thu, 13 Oct 2016 11:30:21 +0000 (UTC) Date: Thu, 13 Oct 2016 11:30:21 +0000 (UTC) From: "Serge Sozonoff (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 archived-at: Thu, 13 Oct 2016 11:30:23 -0000 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1613?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15571652#comment-15571652 ]=20 Serge Sozonoff commented on HTTPCLIENT-1613: -------------------------------------------- Does not work for us with 4.5.2 and Amazon S3.... Further more this workaround=20 {code:java} CloseableHttpClient client =3D HttpClients.custom() .setSSLHostnameVerifier(new DefaultHostnameVerifier(null)) .build(); {code} Does not work either for the simple reason {code:java} public CloseableHttpClient build() { // Create main request executor // We copy the instance fields to avoid changing them, and rename t= o avoid accidental use of the wrong version PublicSuffixMatcher publicSuffixMatcherCopy =3D this.publicSuffixMa= tcher; if (publicSuffixMatcherCopy =3D=3D null) { publicSuffixMatcherCopy =3D PublicSuffixMatcherLoader.getDefaul= t(); } {code} > 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 (classic) > 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