Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 5639 invoked from network); 4 Mar 2007 12:29:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2007 12:29:12 -0000 Received: (qmail 40894 invoked by uid 500); 4 Mar 2007 12:29:20 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 40869 invoked by uid 500); 4 Mar 2007 12:29:20 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 40859 invoked by uid 99); 4 Mar 2007 12:29:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 04:29:20 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 04:29:11 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DDCBC714338 for ; Sun, 4 Mar 2007 04:28:50 -0800 (PST) Message-ID: <21192650.1173011330906.JavaMail.jira@brutus> Date: Sun, 4 Mar 2007 04:28:50 -0800 (PST) From: "Oleg Kalnichevski (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Commented: (HTTPCLIENT-641) Resource Leakage when loading keystore in AuthSSLProtocolSocketFactory In-Reply-To: <22126600.1172983730853.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-641?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477777 ]= =20 Oleg Kalnichevski commented on HTTPCLIENT-641: ---------------------------------------------- Hi Odi I think there is no need to re-vote on 3.1 RC1 because both classes are not= a part of the official release package. =20 Hanson, If you are already a Jakarta committer, you should have commit rights for C= ommons HttpClient. Just go ahead and apply the fixes. Oleg > Resource Leakage when loading keystore in AuthSSLProtocolSocketFactory > ---------------------------------------------------------------------- > > Key: HTTPCLIENT-641 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-641 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: Contrib > Affects Versions: 3.0.1 > Environment: All > Reporter: Hanson Char > Assigned To: Ortwin Gl=C3=BCck > Fix For: 3.1 RC1 > > Attachments: patch.txt > > > Opened stream not closed after keystore is loaded, resulting in resource = leakage: > private static KeyStore createKeyStore(final URL url, final String passwo= rd)=20 > throws KeyStoreException, NoSuchAlgorithmException, CertificateEx= ception, IOException > { > if (url =3D=3D null) { > throw new IllegalArgumentException("Keystore url may not be n= ull"); > } > LOG.debug("Initializing key store"); > KeyStore keystore =3D KeyStore.getInstance("jks"); > keystore.load(url.openStream(), password !=3D null ? password.toC= harArray(): null); > return keystore; > } > Should be changed to something like: > private static KeyStore createKeyStore(final URL url, final String passwo= rd)=20 > throws KeyStoreException, NoSuchAlgorithmException, CertificateEx= ception, IOException > { > if (url =3D=3D null) { > throw new IllegalArgumentException("Keystore url may not be n= ull"); > } > LOG.debug("Initializing key store"); > KeyStore keystore =3D KeyStore.getInstance("jks"); > InputStream is =3D ulr.openStream(); > try { > keystore.load(is, password !=3D null ? password.toCharArray(): = null); > } finally { > is.close(); > } > return keystore; > } --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org