Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 76943 invoked from network); 4 Mar 2004 13:42:16 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Mar 2004 13:42:16 -0000 Received: (qmail 89659 invoked by uid 500); 4 Mar 2004 13:37:18 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89620 invoked by uid 500); 4 Mar 2004 13:37:18 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 99986 invoked from network); 4 Mar 2004 07:47:01 -0000 Message-ID: <4046DF42.2040303@myrvold.info> Date: Thu, 04 Mar 2004 08:48:18 +0100 From: Christian Myrvold User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: commons-user@jakarta.apache.org Subject: [HttpClient] Https performance and reverse lookup Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Mar 2004 07:48:18.0110 (UTC) FILETIME=[0EBF95E0:01C401BD] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Greetings, I am currently developing av http/https proxy app and are using the HttpClient to help me. My problem is that the performance is significally slower through my proxy than when I go direct. The webservers I am trying to reach is usually on private networks (i.e. 192.168.1.x) and over a dialup/PPP connection. This means that I have no dns-records for the servers and the HttpClient seems to be suffering from this when I use https. Cause when I add records in my DNS server for the webservers, I get a good performance gain. I asume this is because of reverse DNS lookup. So my question is how do I turn of reverse lookup for my app? Is it in HttpClient or in the SSL library? I've used the SSLSocketFactory that I found on this site. Please look below. Also I would like to know if there are any good tips to ensure good performance with the HttpClient in general? Help is greatly appreciated! Best Regards, Christian Myrvold ************************* /* * ProxySSLSocketFactory.java * * Created on 3. mars 2004, 14:36 */ package no.mitec.sacs.application.proxy; /** * * @author cm */ import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; public class ProxySSLSocketFactory implements SecureProtocolSocketFactory { private static class TM implements X509TrustManager { public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { } public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { } } private static SSLSocketFactory getSocketFactory() { try { SSLContext context = SSLContext.getInstance("SSL"); context.init(null, new TrustManager[] {new TM()}, null); return context.getSocketFactory(); } catch (Exception e) { throw new RuntimeException(e); } } public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException { return getSocketFactory().createSocket(host, port, clientHost, clientPort); } public Socket createSocket(String host, int port) throws IOException, UnknownHostException { return getSocketFactory().createSocket(host, port); } public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException { return getSocketFactory().createSocket(socket, host, port, autoClose); } } ************************* --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org