Certificate error on using Sparkle THTTPClient in Linux Apache Webbroker

Hi,

In our server application we are using a Sparkle THTTPClient to connect to several servers. When running our application as a Windows GUI we have no issues, however when building an apache webbroker for linux and using a docker we get Certificate errors on using the THTTPClient (Server Certificate Invalid or not present).

We tried replacing the THTTPClient with a standard TRESTRequest and then everything also works ok.

Any ideas why we get this error?
If wanted/needed we can provide a zip containing the docker files/delphi project files.

What is the error message you receive?

You are using THttpClient to connect to a 3rd party server from an Apache WebBroker or are you trying to connect to an Apache WebBroker application?

It's really strange because actually under Linux THttpClient internally uses Delphi native THTTPClient which is the same class used by TRESTRequest.

Hi @wlandgraf we are indeed connecting to a 3rd party server from withing our Apache Webbroker. The strange thing is also when we use the Sparkle THTTPClient form an linux commandline application to connect to the same server, the problem doesnt occur.
I will send you our test project, so you can see for yourself.

What is the error message you get?

We get

Error "Server Certificate Invalid or not present"

I really have no idea. We just call the high-level methods of HTTP client, which in turn uses the OS libraries.

Hi @wlandgraf, how do we proceed from here? Did you receive our project/code which was sent via e-mail? Perhaps we are missing something or have an error in there somewhere....
If a sollution is not found, we might just need to replace the Sparkle THTTPclient and start using the default TRESTClient.

Hi Alex,

I can’t see absolutely nothing wrong with the code. And as I said, we just internally use the Delphi native clients.
Can you try to modify your code to add a third endpoint that uses the native THTTPClient provided in unit System.Net.HttpClient and see what happens?

Hi @wlandgraf thanks for the reply, i initially didnt understand your first answer. When using a native HTTPClient we get the same problem, so if its a Delphi issue we will take it up with Embarcadero.

Have a nice weekend!

Alex

1 Like

I suspected it. But the strangest part is that TRESTRequest also uses System.Net.HttpClient.THTTPClient internally, so there is something missing here.