Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 84785 invoked from network); 18 Apr 2008 23:19:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Apr 2008 23:19:01 -0000 Received: (qmail 97687 invoked by uid 500); 18 Apr 2008 23:19:01 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 97670 invoked by uid 500); 18 Apr 2008 23:19:01 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 97659 invoked by uid 99); 18 Apr 2008 23:19:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 16:19:01 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.150.250.44] (HELO ok2consulting.nine.ch) (217.150.250.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 23:18:09 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 6621F198475; Sat, 19 Apr 2008 01:18:29 +0200 (CEST) Received: from [192.168.1.102] (84-75-108-49.dclient.hispeed.ch [84.75.108.49]) by ok2consulting.nine.ch (Postfix) with ESMTP id 88BA1198472 for ; Sat, 19 Apr 2008 01:18:27 +0200 (CEST) Subject: Re: Problem in SSL Client Authentication using Apache-Commons-HTTPClient API-v3.0 From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: References: Content-Type: text/plain Date: Sat, 19 Apr 2008 01:18:27 +0200 Message-Id: <1208560707.5724.3.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=ham version=3.0.3 On Wed, 2008-04-16 at 13:33 +0500, Muhammad Khurram Saleem wrote: > Hi everyone ! > here is my problem: > *1 -* I'm failing to do SSL Client Authentication using > Apache-Commons-HTTPClient API v 3.0. > *2 -* But I'm successful in doing SSL Server Authentication using > Apache-Commons-HTTPClient API v3.0 > I'm using JDK v-1.5.0_06 > > Following are my steps for 2: > I have override the following settings of JRE for SSL Server Auth: > > System.setProperty( "javax.net.ssl.trustStore" , this.sslKeystoreFilePath); > System.setProperty( "javax.net.ssl.trustStorePassword" , > this.sslKeystorePassword ); > System.setProperty( "java.protocol.handler.pkgs" , > "com.sun.net.ssl.internal.www.protocol" ); > Security.addProvider( *new* com.sun.net.ssl.internal.ssl.Provider() ); > > and Its doing fine. > But I don't find any useful class to do SSL Client Authentication. > I know the way to do SSL Client Authentication using pure JSSE i.e. > > getCertsAndKeysFromPFXWithJSSE(); //Getting Keys and Certs from PFX using JSSE > SSLContext sc = SSLContext.getInstance("SSL"); > sc.init(kmf.getKeyManagers(), null, *null*); //kmf=KeyManagerFactory > SSLSocketFactory f = sc.getSocketFactory(); > SSLSocket c = (SSLSocket) f.createSocket(url, port); > //Enabling Client Authentication > c.setNeedClientAuth(*true*); > printSocketInfo(c); > sendRequest("hello".getBytes(), c, url); > > This code is also working fine. > > But I'm unable to perform the same task using Apache-Commons-HTTPClient API > v 3.0. [I have to use this API]. Is there any way that I can plug my > functionality with Apache-Commons-HTTPClient API v 3.0 at JSSE level. > > please help me in this regard. > Please take a look at the HttpClient SSL guide http://hc.apache.org/httpclient-3.x/sslguide.html Oleg > br > > KS --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org