I'm trying to load a TImage
starting from an URL as explained in this answer.
uses
GIFImg;
procedure TForm1.Button1Click(Sender: TObject);
var
Stream : TMemoryStream;
GIF : TGIFImage;
begin
Stream := TMemoryStream.Create;
GIF := TGIFImage.Create;
try
IdHTTP1.Get('http://www.google.com/intl/en_ALL/images/logo.gif', Stream);
//IdHTTP1.Get('https://www.google.com/intl/en_ALL/images/logo.gif', Stream);
Stream.Position := 0;
GIF.LoadFromStream(Stream);
Image1.Picture.Assign(GIF);
finally
FreeAndNil(GIF);
FreeAndNil(Stream);
end;
end;
All works good if the URL starts with a simple HTTP.
When I try to load from an HTTPS URL, I get an EIdIOHandlerPropInvalid
exception with message:
IOHandler value is not valid.
I've tried adding a TIdSSLIOHandlerSocketOpenSSL
and setting it as IOHandler
for the TIdHTTP
component.
After doing that, I get an EIdOSSLCouldNotLoadSSLLibrary
exception with the following message:
Could not load SSL library.
Is there something wrong in the properties or some other problem?