I have tried setting handshakeTimeout in the ServerHTTP1IOEventHandlerFactory 
constructor:

        httpServer = new DefaultListeningIOReactor(
                new ServerHttp1IOEventHandlerFactory(
                        streamHandlerFactory,
                        tlsStrategy,
                        Timeout.ofSeconds(2)),
                ioReactorConfig,

But same result. Note that in my test, handshake is completed successfully, I 
added a sleep(30s) during data exchange.

Just out of curiosity, I forced a timeout during handshake (instead of during 
data exchange), and it correctly triggered onTimeout callback, but after 
SoTimeout (5 seconds) and not after handshakeTimeout (2 seconds). So it looks 
like this handshakeTimeout is not being correctly enforced either.

Thanks,
Isaac



-----Original Message-----
From: Oleg Kalnichevski <ol...@apache.org> 
Sent: jueves, 15 de junio de 2023 19:46
To: HttpComponents Project <dev@hc.apache.org>
Subject: Re: Idle timeout on HTTPS connections

On Thu, 2023-06-15 at 13:42 -0400, Gary Gregory wrote:
> You could try the 5.2.2 release candidate (see the vote thread).
> 
> Gary
> 
> On Thu, Jun 15, 2023, 12:08 Isaac Cruz <isaac.c...@dzsi.com> wrote:
> 
> > 5.2, I tried with 5.2.1 and same
> > 

5.2.2 is unlikely to help here. 

Please do the following: configure handshakeTimeout in the TlsConfig and see if 
that makes any difference.

Oleg



> > -----Original Message-----
> > From: Oleg Kalnichevski <ol...@apache.org>
> > Sent: jueves, 15 de junio de 2023 15:49
> > To: HttpComponents Project <dev@hc.apache.org>
> > Subject: Re: Idle timeout on HTTPS connections
> > 
> > On Thu, 2023-06-15 at 15:46 +0200, Oleg Kalnichevski wrote:
> > > On Thu, 2023-06-15 at 12:29 +0000, Isaac Cruz wrote:
> > > > Hello everyone,
> > > > 
> > > > I'm having issues trying to set an idle timeout on https 
> > > > connections on an asynchronous HTTPS server. This is what I'm 
> > > > doing:
> > > > 
> > > >         IOReactorConfig ioReactorConfig =
> > > > IOReactorConfig.custom()
> > > >                 .setIoThreadCount(4)
> > > >                 .setSoTimeout(5000, TimeUnit.MILLISECONDS)
> > > >                 .setTcpNoDelay(false)
> > > >                 .setSoReuseAddress(true)
> > > >                 .setBacklogSize(0)
> > > >                 .build();
> > > > 
> > > > And passing that ioReactorConfig to DefaultListeningIOReactor, 
> > > > and an IOSessionListener to be notified of timed out 
> > > > connections.
> > > > 
> > > > So the thing is, for plain http connections, that timeout works 
> > > > (my listener is called after 5 seconds, when the other end stops 
> > > > sending data), but on https connections, it does not work, and I 
> > > > need connections to be closed.
> > > > 
> > > > Am I doing something wrong? Is there any other way of closing 
> > > > idle connections?
> > > > 
> > > > Thanks and regards,
> > > > Isaac
> > > > 
> > > 
> > > 
> > 
> > Apologies. What version of HttpCore are you using?
> > 
> > Oleg
> > 
> > > What version of HttpClient are you using?
> > > 
> > > Oleg
> > > 
> > > 
> > > > Disclaimer
> > > > 
> > > > The information contained in this communication from the sender 
> > > > is confidential. It is intended solely for use by the recipient 
> > > > and others authorized to receive it. If you are not the 
> > > > recipient, you are hereby notified that any disclosure, copying, 
> > > > distribution or taking action in relation of the contents of 
> > > > this information is strictly prohibited and may be unlawful.
> > > > 
> > > > This email has been scanned for viruses and malware, and may 
> > > > have been automatically archived by Mimecast, a leader in email 
> > > > security and cyber resilience. Mimecast integrates email 
> > > > defenses with brand protection, security awareness training, web 
> > > > security, compliance and other essential capabilities. Mimecast 
> > > > helps protect large and small organizations from malicious 
> > > > activity, human error and technology failure; and to lead the 
> > > > movement toward building a more resilient world. To find out 
> > > > more, visit our website.
> > > 
> > > 
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For 
> > > additional commands, e-mail: dev-h...@hc.apache.org
> > > 
> > 
> > 
> > -------------------------------------------------------------------
> > --
> > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For
> > additional
> > commands, e-mail: dev-h...@hc.apache.org
> > 
> > Disclaimer
> > 
> > The information contained in this communication from the sender is
> > confidential. It is intended solely for use by the recipient and
> > others
> > authorized to receive it. If you are not the recipient, you are
> > hereby
> > notified that any disclosure, copying, distribution or taking
> > action in
> > relation of the contents of this information is strictly prohibited
> > and may
> > be unlawful.
> > 
> > This email has been scanned for viruses and malware, and may have
> > been
> > automatically archived by Mimecast, a leader in email security and
> > cyber
> > resilience. Mimecast integrates email defenses with brand
> > protection,
> > security awareness training, web security, compliance and other
> > essential
> > capabilities. Mimecast helps protect large and small organizations
> > from
> > malicious activity, human error and technology failure; and to lead
> > the
> > movement toward building a more resilient world. To find out more,
> > visit
> > our website.
> > 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Disclaimer

The information contained in this communication from the sender is 
confidential. It is intended solely for use by the recipient and others 
authorized to receive it. If you are not the recipient, you are hereby notified 
that any disclosure, copying, distribution or taking action in relation of the 
contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been 
automatically archived by Mimecast, a leader in email security and cyber 
resilience. Mimecast integrates email defenses with brand protection, security 
awareness training, web security, compliance and other essential capabilities. 
Mimecast helps protect large and small organizations from malicious activity, 
human error and technology failure; and to lead the movement toward building a 
more resilient world. To find out more, visit our website.

Reply via email to