Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 99269 invoked from network); 4 Mar 2007 11:52:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2007 11:52:12 -0000 Received: (qmail 23273 invoked by uid 500); 4 Mar 2007 11:52:20 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 23248 invoked by uid 500); 4 Mar 2007 11:52: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 23238 invoked by uid 99); 4 Mar 2007 11:52: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 03:52: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 03:52:10 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D4BF8714336 for ; Sun, 4 Mar 2007 03:51:50 -0800 (PST) Message-ID: <15102132.1173009110869.JavaMail.jira@brutus> Date: Sun, 4 Mar 2007 03:51:50 -0800 (PST) From: =?utf-8?Q?Ortwin_Gl=C3=BCck_=28JIRA=29?= To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Updated: (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.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ortwin Gl=C3=BCck updated HTTPCLIENT-641: ------------------------------------ Attachment: patch.txt Objections to include that in RC1? > 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