0

using delphi rad 10.3.2 ... cannot establish correct setting for sslsocket

In code provided, I have tried assigning "IdSSL" many ways. not have worked. Can anyone help? Thank you.

procedure TForm1.Button4Click(Sender: TObject);
var
crlf,json: string;
idHTTP1: TIdHTTP;
//IdSSL: TIdSSLOpenSSL;

ParamList: TStringList;
result:string;
begin

///////////////////
idHTTP1 := Tidhttp.Create(nil);
{
IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  idHTTP1.ReadTimeout := 30000;
  idHTTP1.IOHandler := IdSSL;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Mode := sslmUnassigned;
}//////////////

  ParamList := TStringList.Create;
  try
    ParamList.Add('');
    idHTTP1 := TIdHTTP.Create(nil);
    try
     Result := idHTTP1.post(
     'https://api.census.gov/data/2017/acs/acs5?get=NAME,group(B01001)&for=us:1'
     ,ParamList);
     showmessage(result);
    finally
      idHTTP1.Free;
    end;
  finally
    ParamList.Free;
  end;
end;

expecting return data, never gets that far.

kualoa
  • 17
  • 1
  • 4
  • The exact error message must tell you something. Then, when you link the TIdSSLIOHandlerSocketOpenSSL you may get a different one. Please read those (and post those when you post a question), because an error message is more than lack of success. It's also a source of information, helping you resolve the next setback. – GolezTrol Sep 08 '19 at 12:47
  • Thank you. "IdSSL: TIdSSLIOHandlerSocketOpenSSL;" is the source of the error. The error message is "RSOSSLCouldNotLoadSSLLibrary". possibly missing a uses reference. – kualoa Sep 08 '19 at 17:05
  • Possible missing SSL library libeay32.dll and ssleay32.dll. – Freddie Bell Sep 08 '19 at 18:53
  • Or, using the wrong version of the DLLs. What does Indy's `WhichFailedToLoad()` function report after the error happens? That will tell you why the error error narrowness, either because the DLLs themselves can't be loaded into memory, or because they are missing required exports that Indy uses. – Remy Lebeau Sep 08 '19 at 22:57
  • error raised is "exception class EIdOSSLCouldNotLoadSSLLibrary with message "Could Not Load SSL Library". When Break button is clicked IdSSLOpenSSL opens and highlights " raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary) .. it also says //an exception here probably means that you are using the wrong version //of the openssl libraries. refer to comments at the top of this file.; (that was not helpful)... I understand but am clueless about how to fix this. I am running RAD 10.3.2 with default settings, what library would I load and how? Thank you. – kualoa Sep 09 '19 at 00:44
  • @kualoa I ask again, what does Indy's `WhichFailedToLoad()` function report AFTER the `EIdOSSLCouldNotLoadSSLLibrary` is raised? That function will tell you WHY the error happened. But start with what the comments in Indy's code says. Do you even have the OpenSSL DLLs (`libeay32.dll` and `ssleay32.dll`) in your app's folder, or at least in a folder on your system's search path? Also, are they for OpenSSL 1.0.2 or earlier? Indy does not support OpenSSL 1.1.x yet (work in progress). – Remy Lebeau Sep 10 '19 at 22:59

0 Answers0