How to handle the "Could Not Load SSL Library" error in Delphi 7 when Posting JSON Data

26 views Asked by At

I'm using Delphi 7, with Indy Components 10.0.52 and lkJSON 1.07 My syntax is like this:

  JSONObj := TlkJSONobject.Create;
  JSONObj.Add('data', JSONArray);
  JSONObj.Add('access_key', xAccessKey);

  JSONString := TlkJSON.GenerateText(JSONObj);

  RequestBody := TStringStream.Create(JSONString);
  try
    SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);

    SSLHandler.SSLOptions.Method := sslvSSLv23;
    SSLHandler.SSLOptions.Mode := sslmUnassigned;
    SSLHandler.SSLOptions.VerifyMode := [];
    SSLHandler.SSLOptions.VerifyDepth := 0;

    HTTP := TIdHTTP.Create(nil);
    HTTP.IOHandler := SSLHandler;
    try
      ResponseText := HTTP.Post(xAlamatWEB, RequestBody); //{Error "Could Not Load SSL Library" }
      ShowMessage(ResponseText);
    finally
      HTTP.Free;
    end; 
  finally
    RequestBody.Free;
  end;

Please help, how to handle it?

Note: I have installed OpenSSL 32 bit, have also set the Path in Windows, and have also copied libeay32.dll and ssleay32.dll into System32.

I am trying to create a data sending application using JSON and I also hope to be successful in doing it. Thank you for the help.

0

There are 0 answers