Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9D15180BD for ; Tue, 21 Jul 2015 07:18:26 +0000 (UTC) Received: (qmail 94734 invoked by uid 500); 21 Jul 2015 07:18:04 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 94710 invoked by uid 500); 21 Jul 2015 07:18:04 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 94698 invoked by uid 99); 21 Jul 2015 07:18:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 07:18:04 +0000 Date: Tue, 21 Jul 2015 07:18:04 +0000 (UTC) From: "Freeman Fang (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work started] (KARAF-3860) fix [KARAF-3373] Log lower level root cause exception in LDAPLoginModule.doLogin() 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/KARAF-3860?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on KARAF-3860 started by Freeman Fang. ------------------------------------------- > fix [KARAF-3373] Log lower level root cause exception in LDAPLoginModule.= doLogin() > -------------------------------------------------------------------------= --------- > > Key: KARAF-3860 > URL: https://issues.apache.org/jira/browse/KARAF-3860 > Project: Karaf > Issue Type: Improvement > Components: karaf-security > Affects Versions: 2.4.2, 4.0.0 > Reporter: Josef Ludv=C3=AD=C4=8Dek > Assignee: Freeman Fang > Labels: jaas > Attachments: KARAF-3860-improve-logging.patch > > > There was several lines of code introduced by KARAF-3373,=20 > {code:java} > } catch (CommunicationException ce) { > // explicitly catch CommunicationException as it my wrap a lo= wer level root cause. > String rootCause =3D null; > if (ce.getRootCause() !=3D null) > rootCause =3D ce.getRootCause().getMessage(); > logger.warn("Can't connect to the LDAP server: {}", ce.getMes= sage(), rootCause); > throw new LoginException("Can't connect to the LDAP server: "= + ce.getMessage()); > } catch (Exception e) { > logger.warn("Can't connect to the LDAP server: {}", e.getMess= age(), e); > throw new LoginException("Can't connect to the LDAP server: "= + e.getMessage()); > } > {code} > but in case of empty trust store, logs contained only anonymous bind fail= ed: > {code} > 2015-07-17 10:40:13,786 | WARN | qtp1137020936-97 | HttpChannel = | 84 - org.eclipse.jetty.util - 9.2.10.v20150310 | Could not s= end response error 500: java.lang.IllegalStateException: Committed = = = =20 > 2015-07-17 10:40:17,478 | WARN | qtp1137020936-98 | LDAPLoginModule = | 35 - org.apache.karaf.jaas.modules - 4.0.1.SNAPSHOT | Can't = connect to the LDAP server: anonymous bind failed: some.ldap.host:636 = = = =20 > 2015-07-17 10:40:17,479 | ERROR | qtp1137020936-98 | JaasSecurityProvider= | 109 - org.apache.karaf.webconsole.console - 4.0.1.SNAPSHOT |= General Security Exception > javax.security.auth.login.LoginException: Can't connect to the LDAP serve= r: anonymous bind failed: some.ldap.host.com:636=20 > {code} > Please consider attached patch, as it logs all exceptions along with stac= ktrace. > {code} > 2015-07-17 10:53:44,270 | WARN | qtp149032581-115 | LDAPLoginModule = | 35 - org.apache.karaf.jaas.modules - 4.0.1.SNAPSHOT | Can't = connect to the LDAP server: anonymous bind failed: some.ldap.host.com:636 = = = =20 > javax.naming.CommunicationException: anonymous bind failed: some.ldap.hos= t.com:636 [Root exception is javax.net.ssl.SSLException: java.lang.Runtime= Exception: Unexpected error: java.security.InvalidAlgorithmParameterExcepti= on: the trustAnchors parameter must be non-empty] = = =20 > ... > ... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)