Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 14672 invoked from network); 2 Dec 2006 08:03:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Dec 2006 08:03:30 -0000 Received: (qmail 62928 invoked by uid 500); 2 Dec 2006 08:03:38 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 62911 invoked by uid 500); 2 Dec 2006 08:03:38 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 62900 invoked by uid 99); 2 Dec 2006 08:03:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Dec 2006 00:03:38 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MANY_EXCLAMATIONS,PLING_QUERY,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.227.126.177] (HELO moutng.kundenserver.de) (212.227.126.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Dec 2006 00:03:26 -0800 Received: from [85.180.6.21] (helo=[85.180.6.21]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1GqPpw3Ruq-0004Zw; Sat, 02 Dec 2006 09:03:05 +0100 Message-ID: <457133FC.60004@dubioso.net> Date: Sat, 02 Dec 2006 09:06:20 +0100 From: Roland Weber User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061110 SeaMonkey/1.0.6 MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: https now works, but http doesnt?!?! References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:4601b1d39ab4ddfc21c613822e406392 X-Virus-Checked: Checked by ClamAV on apache.org Hello Jake, > When I run under https, I get a log message that I used to get for http > as well: > [INFO] HttpMethodDirector - Redirect requested but followRedirects is > disabled > I was never sure WHY I got that message, as I always called > method.setFollowRedirects(false) and follow the redirects manually. > However, it didn't seem to hurt anything, so I ignored it. Yes, that is not a warning. It is just an INFO message to tell you that you called method.setFollowRedirects(false) and that you need to follow the redirects manually :-) > However, now when I use http, I get this message instead: > [INFO] HttpMethodBase - Discarding unexpected response: HTTP/1.1 100 > Continue "100 Continue" responses are part of the expect-continue handshake you can enable for POST or PUT requests. The "unexpected" in the message means that HttpClient wasn't using the expect-continue handshake, or maybe that the server sent two of the "100 continue" responses. I'm not sure whether that is just strange or actually bad behavior on the side of the server, but it's nothing to worry about at this time. > I then get a 405, Method not allowed error and some really strange HTML > as a response, which I'm sure is just the standard IIS 405 error page, > but since it mentions protocol, I'll include it at the bottom of the > message. That means you are sending a POST to a URL that can only be used for GET. Or else there is a more complicated mismatch, like if you send a HEAD request and the server doesn't like it or some such. > I am POSITIVE I am using the correct url. It DOES have a port, but I've > been using this exact same code before I added the EasySSL* classes, and > it worked just fine. If I manually browse to the same page, I can log in. I think it is just a coincidence that this problem happens now after you've fixed the SSL problem. Have you checked whether somebody updated the server recently and thereby changed the URL you need to use? > Actually, there IS one thing I changed from before. I made my HttpClient > static and access it in synchronized(client) blocks now. My application > is user-bound, and one interaction is always completed before they can > start another anyway, but I added the synchronized blocks for safety. > That couldn't really cause problems, could it? I'm not locking up, just > getting an error from the server. The HttpClient object keeps a default HttpState, where cookies are collected. Try to reset the default state before each interaction to see whether that makes any difference. >From a general design perspective, synchronizing access to the HttpClient is overkill, especially because you have to synchronize full method executions. Install a multithreaded connection manager, create a new HttpState for each interaction instead of using the default state, and then access the static HttpClient object without synchronization. Make sure to shut down the connection manager properly when it is no longer needed. hope that helps, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org