In my Delphi (10.3 community edition) program, I try to use Indy with the OpenSSL library, but I receive an error
Could not load SSL library
My OpenSSL library is version 1.0.2u and I put the libeay32.dll
and ssleay32.dll
files in my program EXE directory, and in Windows\SYSWOW64
and Windows\System32
.
I have installed the Embarcadero Delphi Patch RS1033_Indy_SSL_Patch.
After the exception, I call WhichFailedToLoad()
and the result is
Failed to load libeay32.dll
This is a simple program that raises the exception:
url := 'https://www.google.it';
try
Web := TIdHTTP.Create(nil);
hIOHand := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
hIOHand.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2,sslvSSLv23];
Web.IOHandler := hIOHand;
Web.Request.UserAgent := INET_USERAGENT; //Custom user agent string
Web.RedirectMaximum := INET_REDIRECT_MAX; //Maximum redirects
Web.HandleRedirects := INET_REDIRECT_MAX <> 0; //Handle redirects
Web.ReadTimeOut := INET_TIMEOUT_SECS * 1000; //Read timeout msec
try
Sito := Web.Get(Url);
Sito := DateToStr(Web.Response.LastModified) + Sito;
except
on e : exception do
stg := WhichFailedToLoad();
end;
finally
Web.Free;
end;
Can you help me to solve the problem?
sslvSSLv23
in theSSLOptions.SSLVersions
property at all. In this particular example,TIdSSLIOHandlerSocketOpenSSL
will simply discard it. - Remy Lebeau