Hi,
I have some legacy application written in C++ Builder XE4. Our client asked us to change some Webservices call to https TLS 1.2. And then problems started. We tried to use Indy HTTP to do this, but only TLS 1.0. was available, after a lot of digging and try outs, we were able to update Indy Components in XE4 (using the documentation available at https://github.com/IndySockets/Indy/wiki/Updating-Indy) and now we are able to do the call using TLS 1.2
The problem now it's that the idHTTP post request is very slow to receive an response (it takes about a minute or more), using Postman it's less than a 1 sec.
Here is the code snippet:
TIdSSLIOHandlerSocketOpenSSL *SSLHandler = new TIdSSLIOHandlerSocketOpenSSL(NULL);
TIdHTTP *IdHTTP1 = new TIdHTTP(NULL);
SSLHandler->SSLOptions->Method = sslvTLSv1_2; //(we add to force this, otherwise we got the "Error connecting with SSL. error 1409442E:SSL routine:ssl3_read_bytes:tlsv1 alert protocol version")
IdHTTP1->IOHandler = SSLHandler;
IdHTTP1->Request->CustomHeaders->AddValue("X_API_KEY", "somevalue");
IdHTTP1->Request->ContentType = "application/json";
//IdHTTP1->Request->ContentType = tipo->Text;
UnicodeString json = "[JSON DATA]"; // Replace with your JSON data
TStringStream *ss = new TStringStream(json);
UnicodeString response = IdHTTP1->Post("https://TheServiceURL", ss); // ---> THIS TAKES ABOUT 1 MINUTE TO EXECUTE
ShowMessage("Response Rest: " + response);
Some help would be appreciated. Thank you.