From httpclient-userstylertodd@example.com Thu Jul 01 10:05:42 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 46894 invoked from network); 1 Jul 2010 10:05:41 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 10:05:41 -0000 Received: (qmail 93330 invoked by uid 500); 1 Jul 2010 10:05:41 -0000 Delivered-To: tylertodd@example.com Received: (qmail 93012 invoked by uid 500); 1 Jul 2010 10:05:38 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 93004 invoked by uid 99); 1 Jul 2010 10:05:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 10:05:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-vw0-f51.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 10:05:29 +0000 Received: by vws11 with SMTP id 11so2098628vws.10 for <tylertodd@example.com>; Thu, 01 Jul 2010 03:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=LuhDznhqaUtDtZlti4XD5Clsonvl01IA3Z8rWsOruxw=; b=CwXDucq7TKe3aGFIA0KXOkeFN99y4H4e3NKjR01Sdc76IN+374GZQ1nh1exqySGcY3 zfIOvHFQswVRMzoxF6AbvZprn0ckftnqa/3go33AA6g7UYeVTxtVa/fU+gd7v5UDDetZ jzq2ntayJvUUd2Mi+7mZy6V1ELJvpNCZqcS+M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LaYWy+RIgNY9ikHuTWbiSYrS6i/reLuAhM0kb/znddLYx0lsAdYm/WPDallB8z6igU a9ehDMUNGSMYVaJx/pytYCaa62P4l/4F8HsKODjjOMddm8OXumZV4+bsNfWS/5HL/gIH 1DmrR1/2A2KV2ltrV6JmhEeeLK7q26ePM9Bkc= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id mo18mr5994872qcb.239.1277978648747; Thu, 01 Jul 2010 03:04:08 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Thu, 1 Jul 2010 03:04:08 -0700 (PDT) Date: Thu, 1 Jul 2010 15:34:08 +0530 Message-ID: <tylertodd@example.com> Subject: multipart post problem From: Chandraprakash Bhagtani <tylertodd@example.com> To: tylertodd@example.com Content-Type: multipart/alternative; boundary=0016363b8e10639d7c048a509731 X-Virus-Checked: Checked by ClamAV on apache.org --0016363b8e10639d7c048a509731 Content-Type: text/plain; charset=ISO-8859-1 Hi, I am using multipart post method to upload large file on my http server. But the problem is it append the header in the destination file. My file is the plain text file. Is there any configuration setting that I need to do in order to avoid this problem? -- Thanks & Regards, Chandra Prakash Bhagtani --0016363b8e10639d7c048a509731-- From httpclient-userstylertodd@example.com Thu Jul 01 12:28:03 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 87415 invoked from network); 1 Jul 2010 12:28:02 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 12:28:02 -0000 Received: (qmail 38746 invoked by uid 500); 1 Jul 2010 12:28:02 -0000 Delivered-To: tylertodd@example.com Received: (qmail 38465 invoked by uid 500); 1 Jul 2010 12:28:00 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 38345 invoked by uid 99); 1 Jul 2010 12:27:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 12:27:59 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 12:27:52 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OUIrb-00022e-Ir for tylertodd@example.com; Thu, 01 Jul 2010 05:27:31 -0700 Message-ID: <tylertodd@example.com> Date: Thu, 1 Jul 2010 05:27:31 -0700 (PDT) From: dushyant masta <tylertodd@example.com> To: tylertodd@example.com Subject: unable to get header information from the response MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am sending a request to the sample.aspx page where the server adds some string and header information in the response . when i fetch the response , i am able to get the response in the string but unable to get the header part. can ;someone tell me whats going wrong? thanks, Dushyant kumar masta -- View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Thu Jul 01 13:58:56 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 20762 invoked from network); 1 Jul 2010 13:58:56 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 13:58:56 -0000 Received: (qmail 69727 invoked by uid 500); 1 Jul 2010 13:58:56 -0000 Delivered-To: tylertodd@example.com Received: (qmail 69448 invoked by uid 500); 1 Jul 2010 13:58:53 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 69426 invoked by uid 99); 1 Jul 2010 13:58:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 13:58:51 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-fx0-f51.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 13:58:45 +0000 Received: by fxm15 with SMTP id 15so1359957fxm.10 for <tylertodd@example.com>; Thu, 01 Jul 2010 06:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=YkD/CteA2BZCbg3MSkikDtfY6iI9EeFNW96T0oh84no=; b=FHGuTNhFegseKHJvKEcTPOqWlIn4n6sW7igcErzMc3k0uMdXpLm8Gs8fFrffTqHK69 CAxo/gnfX8ounxV11dGd0jQ/aC/drltrJrhLwnMKMwPe52L4rq49duk+VcXtUHQfToyw rHIjJaKGtcsr06ddKa2p3Dpd+Uw4ImPDgyEvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OaXMDNcK5UJ/+tGmSwythiqVKAG1lbYvehMCS7gxMKv5rFwFbu5CW7BxIXnFtFq2Pt CtoYlNkNbUII8l5QQGu7gUbedzHqbn+34sIJT1zrdwmHNedoHBguGAkZaKwe87qav53l 5t8ZQ9hanhmv13Uu/WVluIBJt576iPTE7IMrI= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id q20mr7283476bkk.98.1277992701187; Thu, 01 Jul 2010 06:58:21 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Thu, 1 Jul 2010 06:58:21 -0700 (PDT) In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> Date: Thu, 1 Jul 2010 14:58:21 +0100 Message-ID: <tylertodd@example.com> Subject: Re: unable to get header information from the response From: Sam Crawford <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org What version are you using? Can you enable header logging, as per the documentation? See http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0 Thanks, Sam On 1 July 2010 13:27, dushyant masta <tylertodd@example.com> wrote: > > Hi, > > I am sending a request to the sample.aspx page where the server adds some > string and header information in the response . when i fetch the response , > i am able to get the response in the string but unable to get the header > part. can ;someone tell me whats going wrong? > > thanks, > Dushyant kumar masta > -- > View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html > Sent from the HttpClient-User mailing list tylertodd@example.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tylertodd@example.com > For additional commands, e-mail: tylertodd@example.com > > --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Thu Jul 01 18:14:42 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 35220 invoked from network); 1 Jul 2010 18:14:41 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 18:14:41 -0000 Received: (qmail 76920 invoked by uid 500); 1 Jul 2010 18:14:41 -0000 Delivered-To: tylertodd@example.com Received: (qmail 76872 invoked by uid 500); 1 Jul 2010 18:14:40 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 76864 invoked by uid 99); 1 Jul 2010 18:14:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 18:14:40 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qw0-f51.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 18:14:33 +0000 Received: by qwk3 with SMTP id 3so776322qwk.10 for <tylertodd@example.com>; Thu, 01 Jul 2010 11:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=iIk5gcoXxoid+VaHHY9T717w6PZ1Ek4lNqf00kNP0Yw=; b=It6Zr8zLL49X/+me9dG40R1Bx+Zwg6BgL2m6P06u/bNYEFZ2y7E92RcFPCPuIijIaJ gY7hPLkb1L1YMtSx6/nH/nSeQ9n2MhEBw2lPXbvJoNhLmG2bshhwloXjYt+qUUW80HeT vOxrvpsA9rApP1SW3VkNPDdCDpJgk/ilPSctE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vBlezoTzu7Km8i2+jsH/Gy8XwK1V1jTMbLGXhj1wrEL74GSj8hn+677rCKAtaP3UBd 0x2kNl+VZqW6ldZlSKQfERQzyx639okBmTgDAajfMzBgYDNczIBmjECpPmoKr/6GSgkT i34Ri3uiL06MhE0y5OPanvNTx+7W3Y8K2etSQ= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id v4mr7865434qao.36.1278008003174; Thu, 01 Jul 2010 11:13:23 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Thu, 1 Jul 2010 11:13:22 -0700 (PDT) Date: Thu, 1 Jul 2010 23:43:22 +0530 Message-ID: <tylertodd@example.com> Subject: How to initiate CRL check or OCSP check with httpclient 4.0 From: arpita k <tylertodd@example.com> To: tylertodd@example.com Content-Type: multipart/alternative; boundary=00c09f83a5b80ca1e8048a576d8c X-Virus-Checked: Checked by ClamAV on apache.org --00c09f83a5b80ca1e8048a576d8c Content-Type: text/plain; charset=ISO-8859-1 Hi, I am using Httplcient 4.0 to communicate between client and the server. The client is written in Java and the server is IIS.SO, I am doing mutual authentication to establish the SSL connection between these two. I like to initiate the CRL check for the server certificate. I am using normal Httpclient 4.0 and httpcore 4.0 .So, I believe it is not initiating any CRL checking by its own. Please let me know how to initiate the CRL check or OCSP check when I am using httpclient 4.0?? Thanks, Arpita Kundu --00c09f83a5b80ca1e8048a576d8c-- From httpclient-userstylertodd@example.com Fri Jul 02 05:40:43 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 12853 invoked from network); 2 Jul 2010 05:40:43 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Jul 2010 05:40:43 -0000 Received: (qmail 71216 invoked by uid 500); 2 Jul 2010 05:40:43 -0000 Delivered-To: tylertodd@example.com Received: (qmail 70919 invoked by uid 500); 2 Jul 2010 05:40:40 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 70911 invoked by uid 99); 2 Jul 2010 05:40:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 05:40:39 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 05:40:32 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OUYyx-0006t6-Tr for tylertodd@example.com; Thu, 01 Jul 2010 22:40:11 -0700 Message-ID: <tylertodd@example.com> Date: Thu, 1 Jul 2010 22:40:11 -0700 (PDT) From: dushyant masta <tylertodd@example.com> To: tylertodd@example.com Subject: Re: unable to get header information from the response In-Reply-To: <tylertodd@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com References: <tylertodd@example.com> <tylertodd@example.com> X-Virus-Checked: Checked by ClamAV on apache.org I am using version - commons-httpclient-3.1 thanks, Dushyant Sam Crawford wrote: > > What version are you using? > > Can you enable header logging, as per the documentation? See > http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0 > > Thanks, > > Sam > > > On 1 July 2010 13:27, dushyant masta <tylertodd@example.com> wrote: >> >> Hi, >> >> I am sending a request to the sample.aspx page where the server adds some >> string and header information in the response . when i fetch the response >> , >> i am able to get the response in the string but unable to get the header >> part. can ;someone tell me whats going wrong? >> >> thanks, >> Dushyant kumar masta >> -- >> View this message in context: >> http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html >> Sent from the HttpClient-User mailing list tylertodd@example.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tylertodd@example.com >> For additional commands, e-mail: tylertodd@example.com >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tylertodd@example.com > For additional commands, e-mail: tylertodd@example.com > > > -- View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29052533.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Fri Jul 02 06:47:55 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 37240 invoked from network); 2 Jul 2010 06:47:55 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Jul 2010 06:47:55 -0000 Received: (qmail 41195 invoked by uid 500); 2 Jul 2010 06:47:54 -0000 Delivered-To: tylertodd@example.com Received: (qmail 40754 invoked by uid 500); 2 Jul 2010 06:47:51 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 40746 invoked by uid 99); 2 Jul 2010 06:47:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 06:47:50 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 06:47:43 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OUa1y-00038V-Pk for tylertodd@example.com; Thu, 01 Jul 2010 23:47:22 -0700 Message-ID: <tylertodd@example.com> Date: Thu, 1 Jul 2010 23:47:22 -0700 (PDT) From: dushyant masta <tylertodd@example.com> To: tylertodd@example.com Subject: Re: unable to get header information from the response In-Reply-To: <tylertodd@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com References: <tylertodd@example.com> <tylertodd@example.com> <tylertodd@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Some time the headers are received but sometimes not. dushyant masta wrote: > > I am using version - commons-httpclient-3.1. > i am using the code like > > Header[] headers = method.getResponseHeaders("abc"); > > ......... > > thanks, > Dushyant > > Sam Crawford wrote: >> >> What version are you using? >> >> Can you enable header logging, as per the documentation? See >> http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0 >> >> Thanks, >> >> Sam >> >> >> On 1 July 2010 13:27, dushyant masta <tylertodd@example.com> wrote: >>> >>> Hi, >>> >>> I am sending a request to the sample.aspx page where the server adds >>> some >>> string and header information in the response . when i fetch the >>> response , >>> i am able to get the response in the string but unable to get the header >>> part. can ;someone tell me whats going wrong? >>> >>> thanks, >>> Dushyant kumar masta >>> -- >>> View this message in context: >>> http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html >>> Sent from the HttpClient-User mailing list tylertodd@example.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: tylertodd@example.com >>> For additional commands, e-mail: tylertodd@example.com >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tylertodd@example.com >> For additional commands, e-mail: tylertodd@example.com >> >> >> > > -- View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29052853.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Fri Jul 02 09:09:14 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 81036 invoked from network); 2 Jul 2010 09:09:14 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Jul 2010 09:09:14 -0000 Received: (qmail 20498 invoked by uid 500); 2 Jul 2010 09:09:14 -0000 Delivered-To: tylertodd@example.com Received: (qmail 20044 invoked by uid 500); 2 Jul 2010 09:09:11 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 20023 invoked by uid 99); 2 Jul 2010 09:09:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 09:09:10 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 09:09:03 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OUcEk-00060r-K8 for tylertodd@example.com; Fri, 02 Jul 2010 02:08:42 -0700 Message-ID: <tylertodd@example.com> Date: Fri, 2 Jul 2010 02:08:42 -0700 (PDT) From: dushyant masta <tylertodd@example.com> To: tylertodd@example.com Subject: Re: unable to get header information from the response In-Reply-To: <tylertodd@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com References: <tylertodd@example.com> <tylertodd@example.com> <tylertodd@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Some time the headers are received but sometimes not. I am using version - commons-httpclient-3.1. i am using the code like Header[] headers = method.getResponseHeaders("abc"); ..... Thanks, Dushyant dushyant masta wrote: > > > > > > Sam Crawford wrote: >> >> What version are you using? >> >> Can you enable header logging, as per the documentation? See >> http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0 >> >> Thanks, >> >> Sam >> >> >> On 1 July 2010 13:27, dushyant masta <tylertodd@example.com> wrote: >>> >>> Hi, >>> >>> I am sending a request to the sample.aspx page where the server adds >>> some >>> string and header information in the response . when i fetch the >>> response , >>> i am able to get the response in the string but unable to get the header >>> part. can ;someone tell me whats going wrong? >>> >>> thanks, >>> Dushyant kumar masta >>> -- >>> View this message in context: >>> http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html >>> Sent from the HttpClient-User mailing list tylertodd@example.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: tylertodd@example.com >>> For additional commands, e-mail: tylertodd@example.com >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tylertodd@example.com >> For additional commands, e-mail: tylertodd@example.com >> >> >> > > -- View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29053902.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Fri Jul 02 10:45:24 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 3040 invoked from network); 2 Jul 2010 10:45:24 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Jul 2010 10:45:24 -0000 Received: (qmail 96795 invoked by uid 500); 2 Jul 2010 10:45:24 -0000 Delivered-To: tylertodd@example.com Received: (qmail 96446 invoked by uid 500); 2 Jul 2010 10:45:21 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 96436 invoked by uid 99); 2 Jul 2010 10:45:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 10:45:20 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2cons2.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 10:45:11 +0000 Received: from [83.161.120.155] (77-57-192-27.dclient.hispeed.ch [83.161.120.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 757D64BA251 for <tylertodd@example.com>; Fri, 2 Jul 2010 12:44:51 +0200 (CEST) Subject: Re: How to initiate CRL check or OCSP check with httpclient 4.0 From: Oleg Kalnichevski <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 02 Jul 2010 12:44:50 +0200 Message-ID: <1278067490.2722.5.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Thu, 2010-07-01 at 23:43 +0530, arpita k wrote: > Hi, > > I am using Httplcient 4.0 to communicate between client and the server. The > client is written in Java and the server is IIS.SO, I am doing mutual > authentication to establish the SSL connection between these two. I like to > initiate the CRL check for the server certificate. I am using normal > Httpclient 4.0 and httpcore 4.0 .So, I believe it is not initiating any CRL > checking by its own. > > Please let me know how to initiate the CRL check or OCSP check when I am > using httpclient 4.0?? > > HttpClient relies on the standard JSSE mechanisms for SSL transport encryption. Please refer to the JSSE documentation for instructions on activating CRL / OCSP checks. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Fri Jul 02 13:27:06 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 50538 invoked from network); 2 Jul 2010 13:27:06 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Jul 2010 13:27:06 -0000 Received: (qmail 94078 invoked by uid 500); 2 Jul 2010 13:27:06 -0000 Delivered-To: tylertodd@example.com Received: (qmail 93561 invoked by uid 500); 2 Jul 2010 13:27:03 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 93545 invoked by uid 99); 2 Jul 2010 13:27:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 13:27:02 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gy0-f179.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 13:26:55 +0000 Received: by gyd10 with SMTP id 10so1584602gyd.10 for <tylertodd@example.com>; Fri, 02 Jul 2010 06:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mNkFNt4M92oyaediuOBCUJ5bLMcAbZY1Sjzbe29+f90=; b=x7EH7+voeFEyvvoyUoeALNl0Rxb+U2lo4FXhtAJvjaTWNG+2vwZ6ngTION0FUHOtH0 65mrVqKkcIGQoy58ig9n3LiT1nqgZ70QPfvmPOR22zjEWFz7r7m1JvkYH+JcQrSb4v7e 6BtzrWeY+jSXW1OOw8UzfeE4S8MJh80tquiOs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UjsCRQMRdYch3JPHlWOQY96DClgpYn3Och8lsvOqjhT1FRxmAmHyFh3O/VEKHKiPK4 WG84v28cHHLDdzZXn3MtnV0URj5M+58cE224RLAsgQRU49YfWaTdLI/yzQM7kvs1bkRq DlTek1uwUWnRDB6hm3VfXg8YZCAw/a27vs++g= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id l9mr852007ann.184.1278077134517; Fri, 02 Jul 2010 06:25:34 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Fri, 2 Jul 2010 06:25:34 -0700 (PDT) In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> <tylertodd@example.com> <tylertodd@example.com> <tylertodd@example.com> Date: Fri, 2 Jul 2010 09:25:34 -0400 Message-ID: <tylertodd@example.com> Subject: Re: unable to get header information from the response From: David Motes <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Here is code that I use from 3.1 and it works.. It is looking for a test header called X-TEST-Premise, while looping through the response headers. Header[] responseHeaders =3D method.getResponseHeaders(); boolean bHitPremise =3D false; for (int i=3D0; i<responseHeaders.length; i++){ String tempString =3D responseHeaders[i].getName(); =09 if ( tempString.equals( "X-TEST-Premise" ) ) { bHitPremise =3D true; tempString =3D responseHeaders[i].getValue(); if ( !tempString.equals( "FolderList" ) ) { isCorrect =3D false; } } =09 //System.out.print(responseHeaders[i]); } On Fri, Jul 2, 2010 at 5:08 AM, dushyant masta <tylertodd@example.com> w= rote: > > Some time the headers are received but sometimes not. > I am using version - commons-httpclient-3.1. > =A0i am using the code like > > Header[] headers =3D method.getResponseHeaders("abc"); > ..... > Thanks, > Dushyant > > dushyant masta wrote: >> >> >> >> >> >> Sam Crawford wrote: >>> >>> What version are you using? >>> >>> Can you enable header logging, as per the documentation? See >>> http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0 >>> >>> Thanks, >>> >>> Sam >>> >>> >>> On 1 July 2010 13:27, dushyant masta <tylertodd@example.com> wrote: >>>> >>>> Hi, >>>> >>>> I am sending a request to the sample.aspx page where the server adds >>>> some >>>> string and header information in the response . when i fetch the >>>> response , >>>> i am able to get the response in the string but unable to get the head= er >>>> part. can ;someone tell me whats going wrong? >>>> >>>> thanks, >>>> Dushyant kumar masta >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/unable-to-get-header-information-from-the-respon= se-tp29045063p29045063.html >>>> Sent from the HttpClient-User mailing list tylertodd@example.com. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: tylertodd@example.com >>>> For additional commands, e-mail: tylertodd@example.com >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: tylertodd@example.com >>> For additional commands, e-mail: tylertodd@example.com >>> >>> >>> >> >> > > -- > View this message in context: http://old.nabble.com/unable-to-get-header-= information-from-the-response-tp29045063p29053902.html > Sent from the HttpClient-User mailing list tylertodd@example.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tylertodd@example.com > For additional commands, e-mail: tylertodd@example.com > > --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Sun Jul 04 06:46:15 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 56443 invoked from network); 4 Jul 2010 06:46:15 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 4 Jul 2010 06:46:15 -0000 Received: (qmail 15306 invoked by uid 500); 4 Jul 2010 06:46:15 -0000 Delivered-To: tylertodd@example.com Received: (qmail 14869 invoked by uid 500); 4 Jul 2010 06:46:12 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 14861 invoked by uid 99); 4 Jul 2010 06:46:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jul 2010 06:46:11 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jul 2010 06:46:04 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OVIuQ-0000Zc-II for tylertodd@example.com; Sat, 03 Jul 2010 23:42:34 -0700 Message-ID: <tylertodd@example.com> Date: Sat, 3 Jul 2010 23:42:34 -0700 (PDT) From: "droidin.net" <tylertodd@example.com> To: tylertodd@example.com Subject: Cookie problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com X-Virus-Checked: Checked by ClamAV on apache.org I'm trying to mimic OAuth authentication using HttpClient 4. That requires 2 calls - first I do GET to obtain the form and then I do POST to get security code. GET works just fine - I get the form, no error. If I input GET URL in the browser (JS disabled) and submit - everything works, however when I do HttpPost using the same instance of HttpClient I was using to execute GET I get an error complaining that my cookies are disabled. Indeed if I clear cookies in the browser after I execute GET and obtain the form I get the same error. I was under impression that if I use the same HttpClient for 2 different calls (GET & POST) it will retain the cookies. Am I wrong? And if yes - what should I do to pass cookies to the subsequent POST? Thanks, Bo Stone -- View this message in context: http://old.nabble.com/Cookie-problem-tp29067577p29067577.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Sun Jul 04 18:39:32 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 96263 invoked from network); 4 Jul 2010 18:39:31 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 4 Jul 2010 18:39:31 -0000 Received: (qmail 96944 invoked by uid 500); 4 Jul 2010 18:39:31 -0000 Delivered-To: tylertodd@example.com Received: (qmail 96899 invoked by uid 500); 4 Jul 2010 18:39:30 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 96891 invoked by uid 99); 4 Jul 2010 18:39:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jul 2010 18:39:30 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,NORMAL_HTTP_TO_IP,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jul 2010 18:39:23 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OVU5m-0006Ey-I2 for tylertodd@example.com; Sun, 04 Jul 2010 11:39:02 -0700 Message-ID: <tylertodd@example.com> Date: Sun, 4 Jul 2010 11:39:02 -0700 (PDT) From: Jacky-Zhu-1 <tylertodd@example.com> To: tylertodd@example.com Subject: How to use httpclient4.0 to connect HTTPS via socks proxy? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com X-Virus-Checked: Checked by ClamAV on apache.org I've been trying to use httpclient4.0 to connect https server via socks proxy, but it failed again and again. My code is something like this: KeyStore ks = loadCertFromFile(certFileName, passphrase); X509TrustManager trustManager = getTrustManager(ks); SocketFactory sf = new SocksSSLSocketFactory(getSSLContext(trustManager), "83.161.120.155", 1080); DefaultHttpClient httpclient = new DefaultHttpClient(); ClientConnectionManager ccm = httpclient.getConnectionManager(); SchemeRegistry schemeRegistry = ccm.getSchemeRegistry(); schemeRegistry.register(new Scheme("https", sf, portNumber)); httpResponse = httpclient.execute(httpHost, httpUriRequest); public class SocksSSLSocketFactory implements SocketFactory { private String proxyHost; private int proxyPort; private String userName; private String passWd; private final javax.net.ssl.SSLSocketFactory socketfactory; public SocksSSLSocketFactory(SSLContext sslContext, String socksHost, int socksPort) { this(sslContext, socksHost, socksPort, null, null); } public SocksSSLSocketFactory(SSLContext sslContext, String socksHost, int socksPort, String userName, String passWd) { this.socketfactory = sslContext.getSocketFactory(); proxyHost = socksHost; proxyPort = socksPort; this.userName = userName; this.passWd = passWd; } public Socket createSocket() throws IOException { return (SSLSocket) this.socketfactory.createSocket(); } public Socket connectSocket(Socket sock, String host, int port, InetAddress localAddress, int localPort, HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (host == null) { throw new IllegalArgumentException("Target host may not be null."); } if (params == null) { throw new IllegalArgumentException("Parameters may not be null."); } InetSocketAddress epoint = new InetSocketAddress(host, port); sock = getSocketConnected(epoint); SSLSocket sslSocket = (SSLSocket)this.socketfactory.createSocket(sock, host, port, false); if ((localAddress != null) || (localPort > 0)) { // we need to bind explicitly if (localPort < 0) { localPort = 0; // indicates "any" } InetSocketAddress isa = new InetSocketAddress(localAddress, localPort); sslSocket.bind(isa); } return sock; } public boolean isSecure(Socket sock) throws IllegalArgumentException { if (sock == null) { throw new IllegalArgumentException("Socket may not be null."); } // This check is performed last since it calls a method implemented // by the argument object. getClass() is final in java.lang.Object. if (sock.isClosed()) { throw new IllegalArgumentException("Socket is closed."); } return false; } //generate the socket connected to socks4 proxy server private Socket getSocketConnected(InetSocketAddress endpoint) throws IOException { Socket socket = new Socket(proxyHost, proxyPort); InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream(); out.write(4); out.write(1); out.write((endpoint.getPort() >> 8) & 0xff); out.write((endpoint.getPort() >> 0) & 0xff); out.write(endpoint.getAddress().getAddress()); if (userName != null) { try { out.write(userName.getBytes("ISO-8859-1")); } catch (java.io.UnsupportedEncodingException uee) { assert false; } } out.write(0); out.flush(); byte[] data = new byte[8]; int n = readSocketReply(in, data); if (n != 8) { throw new SocketException("Reply from SOCKS server has bad length: " + n); } if (data[0] != 0 && data[0] != 4) { throw new SocketException("Reply from SOCKS server has bad version"); } SocketException ex = null; switch (data[1]) { case 90: // Success! break; case 91: ex = new SocketException("SOCKS request rejected"); break; case 92: ex = new SocketException("SOCKS server couldn't reach destination"); break; case 93: ex = new SocketException("SOCKS authentication failed"); break; default: ex = new SocketException("Reply from SOCKS server contains bad status"); break; } if (ex != null) { in.close(); out.close(); throw ex; } return socket; } private int readSocketReply(InputStream in, byte[] data) throws IOException { int len = data.length; int received = 0; for (int attempts = 0; received < len && attempts < 3; attempts++) { int count = in.read(data, received, len - received); if (count < 0) throw new SocketException("Malformed reply from SOCKS server"); received += count; } return received; } } But I got java.net.SocketException:Socket is not connected when running: httpResponse = httpclient.execute(httpHost, httpUriRequest); Here is the log. 10-07-05 10:57:42,269 DEBUG -Get connection for route HttpRoute[{}->https://83.161.120.155:9000] [org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:195)] 2010-07-05 10:57:42,269 DEBUG -Get connection for route HttpRoute[{}->https://83.161.120.155:9000] [org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:195)] 2010-07-05 10:57:42,286 DEBUG -Connection shut down [org.apache.http.impl.conn.DefaultClientConnection.shutdown(DefaultClientConnection.java:141)] 2010-07-05 10:57:42,286 DEBUG -Connection shut down [org.apache.http.impl.conn.DefaultClientConnection.shutdown(DefaultClientConnection.java:141)] 2010-07-05 10:57:42,287 DEBUG -Releasing connection org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@19ab6f6 [org.apache.http.impl.conn.SingleClientConnManager.releaseConnection(SingleClientConnManager.java:250)] 2010-07-05 10:57:42,287 DEBUG -Releasing connection org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@19ab6f6 [org.apache.http.impl.conn.SingleClientConnManager.releaseConnection(SingleClientConnManager.java:250)] 2010-07-05 10:57:42,287 ERROR -executeRequest=============================:class:class java.net.SocketException:Socket is not connected [com.trendmicro.imss.ui.modelobjects.prefilter.client.CommonUtils.executeRequest(CommonUtils.java:641)] Actually I have connected to the proxy server in the connectSocket function, I couldn't figure out why it reported this exception? (Why connection shutdown after getconnection?) Anyone can help me? Thank you in advance. -- View this message in context: http://old.nabble.com/How-to-use-httpclient4.0-to-connect-HTTPS-via-socks-proxy--tp29070494p29070494.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Mon Jul 05 12:44:57 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 36695 invoked from network); 5 Jul 2010 12:44:57 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Jul 2010 12:44:57 -0000 Received: (qmail 21618 invoked by uid 500); 5 Jul 2010 12:44:57 -0000 Delivered-To: tylertodd@example.com Received: (qmail 21380 invoked by uid 500); 5 Jul 2010 12:44:54 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 21372 invoked by uid 99); 5 Jul 2010 12:44:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 12:44:53 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2cons2.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 12:44:45 +0000 Received: from [83.161.120.155] (unknown [83.161.120.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id C3B014BA238 for <tylertodd@example.com>; Mon, 5 Jul 2010 14:43:54 +0200 (CEST) Subject: Re: Cookie problem From: Oleg Kalnichevski <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Jul 2010 14:43:46 +0200 Message-ID: <1278333826.11837.6.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sat, 2010-07-03 at 23:42 -0700, droidin.net wrote: > I'm trying to mimic OAuth authentication using HttpClient 4. That requires 2 > calls - first I do GET to obtain the form and then I do POST to get security > code. GET works just fine - I get the form, no error. If I input GET URL in > the browser (JS disabled) and submit - everything works, however when I do > HttpPost using the same instance of HttpClient I was using to execute GET I > get an error complaining that my cookies are disabled. Indeed if I clear > cookies in the browser after I execute GET and obtain the form I get the > same error. > I was under impression that if I use the same HttpClient for 2 different > calls (GET & POST) it will retain the cookies. Am I wrong? As long as the same cookie store instance is used for logically related requests they should share the same logical session and cookies. You can easily see what cookies are received by the client and sent back to the origin server by turning on the wire / context logging. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Mon Jul 05 12:47:20 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 37196 invoked from network); 5 Jul 2010 12:47:20 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Jul 2010 12:47:20 -0000 Received: (qmail 24076 invoked by uid 500); 5 Jul 2010 12:47:19 -0000 Delivered-To: tylertodd@example.com Received: (qmail 23467 invoked by uid 500); 5 Jul 2010 12:47:17 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 23459 invoked by uid 99); 5 Jul 2010 12:47:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 12:47:17 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2cons2.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 12:47:08 +0000 Received: from [83.161.120.155] (unknown [83.161.120.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 7C8334BA238 for <tylertodd@example.com>; Mon, 5 Jul 2010 14:46:47 +0200 (CEST) Subject: Re: How to use httpclient4.0 to connect HTTPS via socks proxy? From: Oleg Kalnichevski <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Jul 2010 14:46:42 +0200 Message-ID: <1278334002.11837.9.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote: > I've been trying to use httpclient4.0 to connect https server via socks > proxy, but it failed again and again. > SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support can be configured using standard JVM settings. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Mon Jul 05 16:00:23 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 79938 invoked from network); 5 Jul 2010 16:00:23 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Jul 2010 16:00:23 -0000 Received: (qmail 4600 invoked by uid 500); 5 Jul 2010 16:00:22 -0000 Delivered-To: tylertodd@example.com Received: (qmail 4543 invoked by uid 500); 5 Jul 2010 16:00:22 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 4535 invoked by uid 99); 5 Jul 2010 16:00:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 16:00:21 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 16:00:15 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OVo2H-0006jF-4I for tylertodd@example.com; Mon, 05 Jul 2010 08:56:45 -0700 Message-ID: <tylertodd@example.com> Date: Mon, 5 Jul 2010 08:56:45 -0700 (PDT) From: Jacky-Zhu-1 <tylertodd@example.com> To: tylertodd@example.com Subject: Re: How to use httpclient4.0 to connect HTTPS via socks proxy? In-Reply-To: <1278334002.11837.9.camel@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com References: <tylertodd@example.com> <1278334002.11837.9.camel@ubuntu> X-Virus-Checked: Checked by ClamAV on apache.org olegk wrote: > > On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote: >> I've been trying to use httpclient4.0 to connect https server via socks >> proxy, but it failed again and again. >> > > SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support > can be configured using standard JVM settings. > > Oleg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tylertodd@example.com > For additional commands, e-mail: tylertodd@example.com > > > Hi Oleg, thanks for your reply. You are right, SOCKS proxy support could be configured using standard JVM settings. But JVM settings is global, it will take effect for all the java socket, this is not what we want, we just want to use SOCKS proxy for part of the java sockets, so we want to go through the SOCKS by using HttpClient. Yes, SOCKS is TCP/IP level, HttpClient focus on HTTP level. But HttpClient supports to create customized socket by implementing the SocketFactory/LayeredSocketFactory, am I right? And JVM supports layered SSLSocket, I've checked the JVM code and the JSSE code, JVM could support to let user pass one connected socket to one SSLSocket. So the solution I have tried is something like this: 1. create one normal socket, and connect it to the proxy server 2. complete the socks protocol using this socket 3. passed this socket to a new created SSLSocket 4. let HttpClient use this new SSLSocket to communicate with HTTPS server I've checked the running status, the steps 1/2/3 are all ok, but the step 4 failed, as the log I have pasted. Could you give me some advices? Or maybe I can read the HttpClient source code to get some clues. -- View this message in context: http://old.nabble.com/How-to-use-httpclient4.0-to-connect-HTTPS-via-socks-proxy--tp29070494p29077304.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Mon Jul 05 19:27:00 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 34581 invoked from network); 5 Jul 2010 19:27:00 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 5 Jul 2010 19:27:00 -0000 Received: (qmail 53152 invoked by uid 500); 5 Jul 2010 19:26:59 -0000 Delivered-To: tylertodd@example.com Received: (qmail 53087 invoked by uid 500); 5 Jul 2010 19:26:59 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 53079 invoked by uid 99); 5 Jul 2010 19:26:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 19:26:59 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2cons2.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 19:26:49 +0000 Received: from [83.161.120.155] (77-57-192-27.dclient.hispeed.ch [83.161.120.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 512E04BA238 for <tylertodd@example.com>; Mon, 5 Jul 2010 21:26:29 +0200 (CEST) Subject: Re: How to use httpclient4.0 to connect HTTPS via socks proxy? From: Oleg Kalnichevski <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> <1278334002.11837.9.camel@ubuntu> <tylertodd@example.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Jul 2010 21:26:24 +0200 Message-ID: <1278357984.3410.1.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Mon, 2010-07-05 at 08:56 -0700, Jacky-Zhu-1 wrote: > > > olegk wrote: > > > > On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote: > >> I've been trying to use httpclient4.0 to connect https server via socks > >> proxy, but it failed again and again. > >> > > > > SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support > > can be configured using standard JVM settings. > > > > Oleg > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tylertodd@example.com > > For additional commands, e-mail: tylertodd@example.com > > > > > > > > Hi Oleg, thanks for your reply. > You are right, SOCKS proxy support could be configured using standard JVM > settings. But JVM settings is global, it will take effect for all the java > socket, this is not what we want, we just want to use SOCKS proxy for part > of the java sockets, so we want to go through the SOCKS by using HttpClient. > Yes, SOCKS is TCP/IP level, HttpClient focus on HTTP level. But HttpClient > supports to create customized socket by implementing the > SocketFactory/LayeredSocketFactory, am I right? > And JVM supports layered SSLSocket, I've checked the JVM code and the JSSE > code, JVM could support to let user pass one connected socket to one > SSLSocket. > > So the solution I have tried is something like this: > 1. create one normal socket, and connect it to the proxy server > 2. complete the socks protocol using this socket > 3. passed this socket to a new created SSLSocket > 4. let HttpClient use this new SSLSocket to communicate with HTTPS server > > I've checked the running status, the steps 1/2/3 are all ok, but the step 4 > failed, as the log I have pasted. > > Could you give me some advices? > Or maybe I can read the HttpClient source code to get some clues. > Have a look at this example. Please note it requires HttpClient 4.1 (still ALPHA) http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Tue Jul 06 02:17:11 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 22496 invoked from network); 6 Jul 2010 02:17:11 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 6 Jul 2010 02:17:11 -0000 Received: (qmail 50265 invoked by uid 500); 6 Jul 2010 02:17:11 -0000 Delivered-To: tylertodd@example.com Received: (qmail 50173 invoked by uid 500); 6 Jul 2010 02:17:10 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 50165 invoked by uid 99); 6 Jul 2010 02:17:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 02:17:10 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tylertodd@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 02:17:03 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <tylertodd@example.com>) id 1OVxiE-0005Yx-Jr for tylertodd@example.com; Mon, 05 Jul 2010 19:16:42 -0700 Message-ID: <tylertodd@example.com> Date: Mon, 5 Jul 2010 19:16:42 -0700 (PDT) From: Jacky-Zhu-1 <tylertodd@example.com> To: tylertodd@example.com Subject: Re: How to use httpclient4.0 to connect HTTPS via socks proxy? In-Reply-To: <1278357984.3410.1.camel@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tylertodd@example.com References: <tylertodd@example.com> <1278334002.11837.9.camel@ubuntu> <tylertodd@example.com> <1278357984.3410.1.camel@ubuntu> X-Virus-Checked: Checked by ClamAV on apache.org olegk wrote: > > On Mon, 2010-07-05 at 08:56 -0700, Jacky-Zhu-1 wrote: >> >> >> olegk wrote: >> > >> > On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote: >> >> I've been trying to use httpclient4.0 to connect https server via >> socks >> >> proxy, but it failed again and again. >> >> >> > >> > SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support >> > can be configured using standard JVM settings. >> > >> > Oleg >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: tylertodd@example.com >> > For additional commands, e-mail: tylertodd@example.com >> > >> > >> > >> >> Hi Oleg, thanks for your reply. >> You are right, SOCKS proxy support could be configured using standard JVM >> settings. But JVM settings is global, it will take effect for all the >> java >> socket, this is not what we want, we just want to use SOCKS proxy for >> part >> of the java sockets, so we want to go through the SOCKS by using >> HttpClient. >> Yes, SOCKS is TCP/IP level, HttpClient focus on HTTP level. But >> HttpClient >> supports to create customized socket by implementing the >> SocketFactory/LayeredSocketFactory, am I right? >> And JVM supports layered SSLSocket, I've checked the JVM code and the >> JSSE >> code, JVM could support to let user pass one connected socket to one >> SSLSocket. >> >> So the solution I have tried is something like this: >> 1. create one normal socket, and connect it to the proxy server >> 2. complete the socks protocol using this socket >> 3. passed this socket to a new created SSLSocket >> 4. let HttpClient use this new SSLSocket to communicate with HTTPS server >> >> I've checked the running status, the steps 1/2/3 are all ok, but the step >> 4 >> failed, as the log I have pasted. >> >> Could you give me some advices? >> Or maybe I can read the HttpClient source code to get some clues. >> > > Have a look at this example. Please note it requires HttpClient 4.1 > (still ALPHA) > > http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java > > Oleg > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tylertodd@example.com > For additional commands, e-mail: tylertodd@example.com > > > Hi Oleg, Thanks for your reply. It seems that your example is only suitable for normal socket, not suitable for sslsocket. I also found in http://old.nabble.com/Fw:-SOCKS-proxy-example---td28306808.html#a28306808 another thread , you have given an similar example for HttpClient4.0, I have tried that solution, it did work for normal socket in HttpClient4.0, but didn't work for sslsocket. So I think this example still cannot work for sslsocket, because for JVM sslsocket, the only solution to using sslsocket via socks proxy is that: create normal socket and connect it to the proxy server; complete the socks protocol using this socket's input/output stream;create one sslsocket using this socket. My problem is how to let HttpClient4.0 use this customized sslsocket..... -- View this message in context: http://old.nabble.com/How-to-use-httpclient4.0-to-connect-HTTPS-via-socks-proxy--tp29070494p29081349.html Sent from the HttpClient-User mailing list tylertodd@example.com. --------------------------------------------------------------------- To unsubscribe, e-mail: tylertodd@example.com For additional commands, e-mail: tylertodd@example.com From httpclient-userstylertodd@example.com Tue Jul 06 19:01:37 2010 Return-Path: <httpclient-userstylertodd@example.com> Delivered-To: tylertodd@example.com Received: (qmail 97873 invoked from network); 6 Jul 2010 19:01:37 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 6 Jul 2010 19:01:37 -0000 Received: (qmail 81423 invoked by uid 500); 6 Jul 2010 19:01:37 -0000 Delivered-To: tylertodd@example.com Received: (qmail 81384 invoked by uid 500); 6 Jul 2010 19:01:36 -0000 Mailing-List: contact tylertodd@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:tylertodd@example.com> List-Unsubscribe: <mailto:tylertodd@example.com> List-Post: <mailto:tylertodd@example.com> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <tylertodd@example.com> Delivered-To: mailing list tylertodd@example.com Received: (qmail 81376 invoked by uid 99); 6 Jul 2010 19:01:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 19:01:36 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2cons2.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 19:01:28 +0000 Received: from [83.161.120.155] (77-57-192-27.dclient.hispeed.ch [83.161.120.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 4E0AE4BA238 for <tylertodd@example.com>; Tue, 6 Jul 2010 21:00:37 +0200 (CEST) Subject: Re: How to use httpclient4.0 to connect HTTPS via socks proxy? From: Oleg Kalnichevski <tylertodd@example.com> To: HttpClient User Discussion <tylertodd@example.com> In-Reply-To: <tylertodd@example.com> References: <tylertodd@example.com> <1278334002.11837.9.camel@ubuntu> <tylertodd@example.com> <1278357984.3410.1.camel@ubuntu> <tylertodd@example.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 06 Jul 2010 21:00:32 +0200 Message-ID: <1278442832.9552.1.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Mon, 2010-07-05 at 19:16 -0700, Jacky-Zhu-1 wrote: > > > olegk wrote: > > > > On Mon, 2010-07-05 at 08:56 -0700, Jacky-Zhu-1 wrote: > >> > >> > >> olegk wrote: > >> > > >> > On Sun, 2010-07-04 at 11:39 -0700, Jacky-Zhu-1 wrote: > >> >> I've been trying to use httpclient4.0 to connect https server via > >> socks > >> >> proxy, but it failed again and again. > >> >> > >> > > >> > SOCKS is a TCP/IP level, not HTTP level protocol. SOCKS proxy support > >> > can be configured using standard JVM settings. > >> > > >> > Oleg > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: tylertodd@example.com > >> > For additional commands, e-mail: tylertodd@example.com > >> > > >> > > >> > > >> > >> Hi Oleg, thanks for your reply. > >> You are right, SOCKS proxy support could be configured using standard JVM > >> settings. But JVM settings is global, it will take effect for all the > >> java > >> socket, this is not what we want, we just want to use SOCKS proxy for > >> part > >> of the java sockets, so we want to go through the SOCKS by using > >> HttpClient. > >> Yes, SOCKS is TCP/IP level, HttpClient focus on HTTP level. But > >> HttpClient > >> supports to create customized socket by implementing the > >> SocketFactory/LayeredSocketFactory, am I right? > >> And JVM supports layered SSLSocket, I've checked the JVM code and the > >> JSSE > >> code, JVM could support to let user pass one connected socket to one > >> SSLSocket. > >> > >> So the solution I have tried is something like this: > >> 1. create one normal socket, and connect it to the proxy server > >> 2. complete the socks protocol using this socket > >> 3. passed this socket to a new created SSLSocket > >> 4. let HttpClient use this new SSLSocket to communicate with HTTPS server > >> > >> I've checked the running status, the steps 1/2/3 are all ok, but the step > >> 4 > >> failed, as the log I have pasted. > >> > >> Could you give me some advices? > >> Or maybe I can read the HttpClient source code to get some clues. > >> > > > > Have a look at this example. Please note it requires HttpClient 4.1 > > (still ALPHA)
{'source': 'Apache Software Foundation Public Mail Archives'}