Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D5A90DE88 for ; Thu, 29 Nov 2012 22:51:02 +0000 (UTC) Received: (qmail 3697 invoked by uid 500); 29 Nov 2012 22:50:58 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 3648 invoked by uid 500); 29 Nov 2012 22:50:58 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 3586 invoked by uid 99); 29 Nov 2012 22:50:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2012 22:50:58 +0000 Date: Thu, 29 Nov 2012 22:50:58 +0000 (UTC) From: "Scott Stanton (JIRA)" To: dev@hc.apache.org Message-ID: <521629425.42728.1354229458727.JavaMail.jiratomcat@arcas> In-Reply-To: <105207383.47993.1350339423661.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (HTTPCORE-319) SSLIOSession goes into a loop if the server rejects an invalid certificate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCORE-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13506903#comment-13506903 ] Scott Stanton commented on HTTPCORE-319: ---------------------------------------- 1) The loop I was seeing was that the socket is readable because of an EOF, SSLIOSession.isAppInputReady is called and detects bytesRead is -1, setting endOfStrream to true. It then continues on to doHandshake, etc and returns to the reactor, leaving the read mask set. Since the socket is still at EOF, the reactor immediately starts the whole process over again. 2) I still don't have a reliable way to reproduce the problem (it only happens a couple of times each day), but I'll try the patch and see if it helps. > SSLIOSession goes into a loop if the server rejects an invalid certificate > -------------------------------------------------------------------------- > > Key: HTTPCORE-319 > URL: https://issues.apache.org/jira/browse/HTTPCORE-319 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO > Affects Versions: 4.2.2 > Reporter: Scott Stanton > Assignee: Oleg Kalnichevski > Priority: Critical > Fix For: 4.2.3 > > Attachments: log > > > To reproduce: > * Set up an SSL server that requests certificates from the client. > * Set up a client with an expired SSL certificate. > * Establish a connection from the client to the server using BaseNIOReactor and SSLIOSession. > The server will proceed through the handshake until the client supplies its certificate in response to the CertificateRequest message. At this point, the server's certificate verification will fail and it will close the connection. > The client socket will become readable due to the EOF and the SSLIOSession.isAppInputReady() method is called to handle the EOF. The bytesRead gets set to -1, which sets this.endOfStream = true. Nothing ever sets the session into the CLOSING or CLOSED state, so it keeps looping on the readable EOF event. > I'm not sure what the best approach to fixing this should be. It appears that if I close the session manually with the debugger from inside isAppInputReady, the system proceeds normally from that point, however I don't know what the implications of doing that might be. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org