Jump to content
Mark Lobanov

TSslHttpCli Request aborted on timeout in thread

Recommended Posts

Hello
I have a Win64 ServiceApplication (no GUI) with separate thread which received a data from specific web-service.

TSslHttpCli created and initialized within the thread constructor

  fHc := TSslHttpCli.Create( nil );
  fHc.RcvdStream := TBytesStream.Create;
  fHc.SendStream := TBytesStream.Create;
  fHc.OnBeforeHeaderSend := hcBeforeHeaderSendHandler;
  fHc.OnCookie := hcOnCookieHandler;
  fHc.SocketFamily := sfAny;
  fHc.RequestVer := '1.1';
  fHc.MultiThreaded := True;
  
  fHc.sslContext := TSslContext.Create( nil );
    fHc.sslContext.SslMinVersion := sslVerTLS1_2;
    fHc.sslContext.SslMaxVersion := sslVerMax;
    fHc.sslContext.SslCliSecurity := TSslCliSecurity.sslCliSecTls12;
    fHc.sslContext.SslVersionMethod := sslBestVer_SERVER;

  fHc.Accept := MC_HTTP_ACCEPT_VALUE;
  fHc.Connection := MC_HTTP_CONNECTION_VALUE;
  fHc.Agent := MC_HTTP_USER_AGENT_VALUE;
  fHc.NoCache := True;
  fHc.ResponseNoException := True;


In CallerThread.Execute a call a GET method in synchronous mode with OpenSsl 3.2.0.

At first glance all works fine but a have a lot of errors "Request aborted on timeout". Remote web service is quite stable.

Maybe I missed something?
Please, help me.

 

Edited by Mark Lobanov
clarification

Share this post


Link to post

Sorry, insufficient information to make any real comment for the errors. 

 

You need proper logging to see when you are making requests and when those responses arrive, which will help explain what is wrong.

 

This is all much easier using the TSslHttpRest component that removes over half your code, and includes logging.  You should try accessing the server using the OverbyteIcsHttpRestTst sample and see if that works better.

 

Angus

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×