Jump to content
Alex40

REST Authentication issue on FMX Windows: Error querying headers (12019): The handle is in the wrong state for the requested operation

Recommended Posts

I am using Rad Studio 12.1 and I am facing the following issue when I am calling my Server:

"Error querying headers (12019): The handle is in the wrong state for the requested operation"

 

I went through these two threads in which people say that the issue comes in 10.4.1, but I am still facing in 12.1:

 

1) https://stackoverflow.com/questions/65928918/delphi-rest-authentication-issues-with-10-4-1

2) https://quality.embarcadero.com/browse/RSP-30732

 

image.thumb.png.f6b280ba03a0af4245491a178d029a35.png

 

I tried the following fix that was suggested, but didn't help:

Please use workaround:

  • at run-time: create TDSRestConnection.OnAuthentication event handler and add lines to it:

     

    if AnAuthTarget = TAuthTargetType.Proxy then
      AUserName := '1';

Has anybody fixed this problem somehow?

 

Any help would be highly appreciated. 

 

Thanks.

Share this post


Link to post

A month and a half later the problem is not fixed YET. 😞

 

Any help would be highly appreciated. 

 

Thank you!

Share this post


Link to post
Posted (edited)
1 hour ago, Cristian Peța said:

RSP-30732 is marked as fixed in 10.4.2.

Can you reproduce it with the sample from that RSP?

If you can reproduce it in 12.1 you should open a new request at https://qp.embarcadero.com/

I was not able to reproduce the same error with the samples from the RSP. It looks like it connects successfully in the samples.

 

The problem is that the error can be reproduced randomly in let say 1/10 times, sometimes 1/20 times when calling the Server. It is really annoying issue.

 

I saw this error for the first time after upgrading to 12.1. I haven't seen it before while we were on Rad Studio 10.4.2

Edited by Alex40

Share this post


Link to post
On 7/29/2024 at 1:17 PM, Alex40 said:

A month and a half later the problem is not fixed YET. 😞

I would consider switching to an HTTP client of your choice and stop using TREST components.

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

×