Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 85C507354 for ; Fri, 14 Oct 2011 07:58:32 +0000 (UTC) Received: (qmail 31623 invoked by uid 500); 14 Oct 2011 07:58:30 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 31510 invoked by uid 500); 14 Oct 2011 07:58:30 -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 31498 invoked by uid 99); 14 Oct 2011 07:58:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 07:58:29 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 07:58:21 +0000 Received: from [192.168.1.148] (77-57-197-206.dclient.hispeed.ch [77.57.197.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 7E43B245E4A7 for ; Fri, 14 Oct 2011 09:58:00 +0200 (CEST) Subject: Re: HttpCore: is there an example for opening HTTPS connections (client side) in the same vein as "ElementalHttpGet.java" ? From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Fri, 14 Oct 2011 09:57:58 +0200 Message-ID: <1318579078.2262.68.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit On Thu, 2011-10-13 at 16:14 -0700, Cardona, Julian wrote: > > Hi! > > I've used the code samples from "ElementalHttpGet" and > "ElementalHttpPost" for my basic HTTP'ing needs without > a glitch so far. Now I need to open an HTTPS connection > and am not sure how to modify those samples to make it > work. > > I've checked the docs and the other examples, no luck > there. The async HTTPS server, for instance, really > has a very different flow and is not immediately > applicable. Same goes for HttpClient: I have to deal > regularly with ill-formed responses, so need to have > access to a bit lower level data --exactly at the level > HttpCore provides it. > > Any resources (tutorials or code samples) on the specific > subject of synchronous, a.k.a. "classic", HTTPS + HttpCore > that I might be overlooking? Thanks in advance! > > > Julian Cardona > > Julian DefaultHttpClientConnection can be bound to any arbitrary Socket. You just need SSLSocketFactory initialized with the required trust and key material. Once SSLSocket is created it can be bound to a DefaultHttpClientConnection. See BasicConnFactory for example http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java Cheers Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org