Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 49318 invoked from network); 17 Apr 2007 12:13:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2007 12:13:37 -0000 Received: (qmail 18138 invoked by uid 500); 17 Apr 2007 12:13:43 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 18100 invoked by uid 500); 17 Apr 2007 12:13:42 -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 18045 invoked by uid 99); 17 Apr 2007 12:13:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 05:13:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 17 Apr 2007 05:13:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B8504714075 for ; Tue, 17 Apr 2007 05:13:15 -0700 (PDT) Message-ID: <22649023.1176811995752.JavaMail.jira@brutus> Date: Tue, 17 Apr 2007 05:13:15 -0700 (PDT) From: "Thomas Mathis (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Created: (HTTPCLIENT-646) HttpClient.executeMethod with absolute URI removes the Protocol from the hostConfiguration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org HttpClient.executeMethod with absolute URI removes the Protocol from the hostConfiguration ------------------------------------------------------------------------------------------ Key: HTTPCLIENT-646 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-646 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpClient Affects Versions: 3.1 RC1 Reporter: Thomas Mathis Testprogram (snippet): public void test() throws IOException { String url = "https://www.somehost.com/somepath"; URL u = new URL(url); Protocol protocol = new Protocol("https", new AcceptAllSSLProtocolSocketFactory(), port); HttpClient httpClient = new HttpClient(); httpClient.getHostConfiguration().setHost(u.getHost(), port, protocol); GetMethod m = new GetMethod(url); httpClient.httpClient.executeMethod(m); System.out.println("status=" + m.getStatusCode()); } Suggested fix in method public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state) .... // make a deep copy of the host defaults hostconfig = (HostConfiguration) hostconfig.clone(); if (uri.isAbsoluteURI()) { //hostconfig.setHost(uri); <-- this line replaces the Protocol with the default one hostconfig.setHost(uri.getHost(), uri.getPort(), hostconfig.getProtocol()); } .... -- 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