Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The HTTPS request is being delayed. #232

Open
kabiri opened this issue Dec 7, 2024 · 4 comments
Open

The HTTPS request is being delayed. #232

kabiri opened this issue Dec 7, 2024 · 4 comments

Comments

@kabiri
Copy link

kabiri commented Dec 7, 2024

I'm using a 'horse' server and when I test it with Postman, the speed is a few milliseconds.
However, when I use RESTRequest4Delphi, it takes 14 or 15 seconds to send the request.
This happens when I have SSL enabled. When SSL is disabled, the speed of RESTRequest4Delphi is good.
My request is:

    lRes := TRequest.New.BaseURL('https://127.0.0.1:8000')
      .Resource('Ping')
      .Accept('Aplication/json')
      .AcceptEncoding('gzip')
      .AcceptCharset('utf-8')
      .BasicAuthentication(ServerUser,ServerPass)
      .Get;
@kabiri
Copy link
Author

kabiri commented Dec 8, 2024

I've added two events, OnBeforeExecute and OnAfterExecute, to TRequest.
My log shows:

17:25:44:663 | Request Data Before Execute
17:26:00:946 | Request Data After Execute

This means there's approximately a 16-second gap between OnBeforeExecute and OnAfterExecute.

@viniciussanchez
Copy link
Owner

Strange, I haven't had this problem yet. Try changing the RR4D engine, to Indy for example. See if it solves it... just add the RR4D_INDY compilation directive to the project, do a clean and build.

@kabiri
Copy link
Author

kabiri commented Dec 12, 2024

Okay, I'll check that. This happens when I use a self-signed certificate. I've seen that you're using TRESTClient. I tested with TRESTClient as well and there was still an issue. The same problem occurred with httpclient too. So, I think the issue might be with Delphi itself.

@kabiri
Copy link
Author

kabiri commented Dec 14, 2024

@viniciussanchez
By defining RR4D_INDY, the sending speed has improved and there is no longer a delay in sending requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants