I know this question has been asked before but none of the answers seem to be appropriate for this situation.
I'm using a TIdHttp component with an SSL handler. My code is as follows:
idHTTPClient := TIdHTTP.Create(nil);
ioHnd := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
ioHnd.DefaultPort := iSSL_PORT;
ioHnd.SSLOptions.Mode := sslmClient;
idHTTPClient.IOHandler := ioHnd;
idHTTPClient.Request.AcceptEncoding := 'gzip,deflate,identity';
idHTTPClient.Request.BasicAuthentication := False;
try
idHTTPClient.Post(FFQDN, stmRequest, stmResponse);
except
on E:Exception do
begin
if IdSSLOpenSSLHeaders.WhichFailedToLoad <> '' then
begin
AddMsg('Failed to load file ' + IdSSLOpenSSLHeaders.WhichFailedToLoad + '. ' + E.Message);
end;
end;
end;
There are three versions of the ssleay32 and libeay32.dll files on the machine. One set is in the same folder as my executable (V1.0.0.5). One set is in the Apache bin folder (V0.9.8.20) and one set is in C:\Windows\SysWOW64 (no version but dated 2003).
When the app starts it runs fine. But after a few days the Post call starts to fail with "Could not load SSL library". The files which fail to load are:
SSL_SESSION_get_id,SSL_COMP_get_compression_methods
Once this problem starts to happen it won't go away until the app is restarted. Then it works fine again for another few days.
It would seem to me that for some reason the dlls being loaded change after a few days. How could this happen and what could I do to ensure the correct files are loaded every time?