Jump to content

mdsantos

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. mdsantos

    Using TLS 1.2 on XE4 to call webservice

    Thank you again, I will try to do that.
  2. mdsantos

    Using TLS 1.2 on XE4 to call webservice

    It's not the case. The json is small, just 237 chars. Also tested with postman in the same machine, it took 1 sec to reply. Restarted the machine, and... the problem was gone, strange. Even so the Indy upgrade was not a smooth ride. We follow the documentation, step by step: - Automated Uninstall script for XE4 Clean_X4.cmd - removing the packages from the IDE - Build the indy project (C++ Builder) with the Fullc_XE4.bat - Setting the lib paths Lib\core, lib\system, lib\protocolos but I got error installing the new packages. "Impossible to locate the specific module".
  3. 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.
×