Hi
I wrote a small app that reads an HTTP url to grab a page of JSON.
This is the code, which compiles in both Delphi and Lazarus:
function ReadHTTPS(const url: string): string;
var
IdHTTP: TIdHTTP;
IdSSL: TIdSSLIOHandlerSocketOpenSSL;
begin
IdHTTP := TIdHTTP.Create;
try
IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP);
IdHTTP.IOHandler := IdSSL;
result := IdHTTP.Get(url);
finally
IdHTTP.Free;
end;
end;
To get that to work in Delphi I dropped in 2 library files, ssleay32.dll and libeay32.dll. I moved that same files over to the a lazarus project but when it runs IdHTTP.Get(url) I get an exception saying "Could not load SSL libraries.
I expect people have solved this before. And advice?
Regards
Mark
To answer Thaddy's questions on the versions:
My machine with both Delphi and Lazarus installed has 64 bit windows 7.
The Delphi is 10.1 Berlin.I have had this working with both 32 and 64 bit targets.
The Lazarus is 1.6.4. It was installed from lazarus-1.6.4-fpc-3.0.2-win64.exe
And that was the problem! It worked once I had the 64 bit libraries in place! I think I wasn't giving FPC credit for 64-bit.