Hey LeadGuit,
Could you please provide us with your FPC version please?
Stable, 3.2.0
There's been a mounting number of posts on the forum due to issues that arose from the update from FPC 3.0.4 to 3.2.0, and SSL, in terms of fphttpclient.
Some, if not most, are problems with SSL. Which is not completely the case here.
I've solved most of the version and SSL issues on the example project attached.
Have a test drive and see if the errors is still present. If so, then you have a problem particular to your installation that needs to be drilled down.
Cheers,
Gus
The sample project works flawlessly. As said, other things work well too, it only concerns Elasticsearch.
I tested it with my "production" instance, which lies on another server behind a VPN, and that works as well. Both my local one and the production operate without SSL.
So my guess is that there is a special constellation that troubles FPC. To elaborate - essentially what I'm doing is running a WSL2 (Windows Subsystem for Linux) on my Win 10. I use the Linux VM for all my dayjob development, so e.g. Elasticsearch is also installed on there. The development in Lazarus takes places on Windows (WSL is only CLI, or GUI via an installed XServer on windows). Could it be that fphttpclient goes "another way" contrary to curl et al? The ES installation is relatively Vanilla. Other thing served from the Linux part are "gettable", on various ports. Just ES is a little reluctant, and only with FP.
E.g. my usual Python scripts on the linux machine work as expected, and a Chrome-Plugin to voew ES Data (on Windows) also connects without issue, curl on the linux subsystem as well as on windows are able to fire the get request.
The other 1 out of 10 the issue is the user agent being used. Does ElasticSearch check user agents?
Not that I know, no - ES mainly offers an API for programmatic consume. The test with my production instance shows that it should work out of the box.