INDY 10.1.5 - Which SSL dlls work with Delphi 2006?
Asked Answered
X

5

17

I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but I am getting the following SSL errors:

1) If I use the SSL dlls from openssl-0.9.8i-i386-win32.zip I get the error:

"Could not load SSL library"

2) If I use the SSL dlls from indy_OpenSSL096m.zip I get the error:

"Error connecting with SSL"

3) If I use the SSL dlls from openssl-0.9.8h-i386-win32-Indy-IntraWebEdition.zip I get the error:

"Could not load SSl Library"

Now I've researched this and there are a lot of recommendations with dead links to dlls about, including links on stack overflow. I suspect I need to find the SSL dlls that are compatible with the version of INDY I am using.

My question is, does anyone know exactly which SSL dlls are compatible with Delphi 2006 & INDY 10.1.5?

Xavierxaviera answered 9/12, 2009 at 15:31 Comment(0)
K
18

I had the same problem even after I upgrading to INDY 10.2.3 and I tryed every different version of the “libeay32.dll” and “ssleay32.dll” files I could find ... Like Matt I always got one of the two errors: "Could not load SSL library" or the "Error connecting with SSL" with something like "error:00000006:lib(0):func(0):EVP lib" ...

I was very happy when I change the TidSSLioHandlerSocketOpenSSL.SSLOptions.Method to sslvSSLv23 and everything started working.

A bit more research and I quickly understood anytime I got the error "Could not load SSL library" I was using the wrong version of the DLL files and anytime I got the "Error connecting with SSL" with something like "error:00000006:lib(0):func(0):EVP lib" I was using the wrong SSLOptions.Method value.

Other Info: I'm using Delphi 2006, INDY 10.2.3 and I'm runnin on WinXP Pro

This caused me so much pain, I hope this post will save someone some time.

Kings answered 12/3, 2010 at 22:7 Comment(2)
Very useful comments, I'm sure these will help others in the same situation. Thanks.Xavierxaviera
+1 this fix did the trick although I had no idea what sslvSSLv23 meant before I read ehow.com/how_5953595_determine-ssl-protocol-version.html I am using the latest Indy9 on D5 Windows2000Twandatwang
S
3

You could resort to some trial and error using downloads from the Fulgan site.

You might want to think about updating your copy of Indy and using the most recent OpenSSL DLLs.

Streamer answered 9/12, 2009 at 17:19 Comment(3)
I think you're right, I need to update INDY and use the most recent OpenSSL dlls.Xavierxaviera
I think it will make things simpler.Streamer
You know what drives me crazy on the Fulgain installers? Some of the installers install directly into the windows installation folder (0.9.8h for instance) -- later installer versions give you a choice. It seems like black magic finding working SSL dlls.Educative
M
3

FWIW, since I have spent a lot of time getting this https thing to work, here are the results of my successful efforts.

1- Delphi 7

2- indy9.0.19_d7.exe

3- IdSSLIOHandlerSocket1.SSLOptions.Method := sslvTLSv1; or,

IdSSLIOHandlerSocket1.SSLOptions.Method := sslvTLSv23; or,

IdSSLIOHandlerSocket1.SSLOptions.Method := sslvTLSv3;

I tried indy10.0.76_d7.exe and indy10.1.5_d7.exe under Delphi 7 and I cannot get them to install properly, let alone get HTTPS to work. I get the infamous message "Unit IdSysWin32 was compiled with a different version of IdException.EIdException." I searched for a solution to that problem on the web and couldn't find one - loads of others had the same message.

A useful site for testing https is https://msp.f-secure.com/web-test/common/test.html

Here is my source:

procedure TForm1.ButtonHTTPSClick(Sender: TObject);
var
  IdHTTP1: TIdHTTP;
  ParamStringList: TStringList;
  s1: String;
  MemoryStream1: TMemoryStream;
  IdSSLIOHandlerSocket1:  TIdSSLIOHandlerSocket;
begin //  ssl works fine must have Indy version indy9.0.19_d7.exe and must use option  sslvSSLv23

  Screen.Cursor := crHourGlass;
  IdHTTP1 := TIdHTTP.Create(nil);
  IdSSLIOHandlerSocket1 := TIdSSLIOHandlerSocket.Create(nil); 
  IdHTTP1.IOHandler := IdSSLIOHandlerSocket1;

//  IdSSLIOHandlerSocket1.SSLOptions.Method := sslvTLSv1; // sslvSSLv1 works fine
    IdSSLIOHandlerSocket1.SSLOptions.Method := sslvSSLv3; // sslvSSLv3 works fine
//  IdSSLIOHandlerSocket1.SSLOptions.Method := sslvSSLv23; // sslvSSLv23 works fine
//  IdSSLIOHandlerSocket1.SSLOptions.Method := sslvSSLv2;   sslvSSLv2 does not work
    IdSSLIOHandlerSocket1.SSLOptions.Mode := sslmUnassigned;
    IdSSLIOHandlerSocket1.SSLOptions.VerifyMode := [];
  IdSSLIOHandlerSocket1.SSLOptions.VerifyDepth := 0;

  ParamStringList := TStringList.Create;
  MemoryStream1 := TMemoryStream.Create;
  s1 := IdHTTP1.Post('https://msp.f-secure.com/web-test/common/test.html', ParamStringList);
  MemoryStream1.Write(s1[1], Length(s1));
  MemoryStream1.Position := 0;
  MemoryStream1.SaveToFile('c:\temp\MemoryStream1.txt');
  Memo1.Lines.Clear;
  Memo1.Lines.LoadFromFile('c:\temp\MemoryStream1.txt');
  MemoryStream1.Free;
  ParamStringList.Free;
  IdSSLIOHandlerSocket1.Free;
  IdHTTP1.Free;
  Screen.Cursor := crDefault;
end;
Manstopper answered 25/4, 2012 at 1:42 Comment(1)
Thanks. It is working fine for me. I have Indy-10.1.5 and Delphi-7, Win-7x64 and SSL dlls from indy_OpenSSL096m.zip with your link msp.f-secure.com/web-test/common/test.html. BUT only if SSLOptions.Method = sslvSSLv23 or sslvTLSv1. I don't have "sslvTLSv23" or "sslvTLSv3" in drop-down list, I have "sslvSSLv2" and "sslvSSLv3" instead. And I'm using "IdHTTP1.get" as simplified version or request with no parameters.Langsdon
S
2

As far as I am aware the more recent versions of Indy work with standard OpenSSL binaries. Download from here. We produced a Delphi FTP client app a while ago using Indy with SSL connections and I'm sure we just shipped the current OpenSSL dlls.

Edit: Just checked the app directory and the DLLs we used are OpenSSL 0.9.8.2 (3-Aug-06). (It's an old app)

Edit 2: And I've just copied the more recent 0.9.8k dlls over and they work fine too.

Synectics answered 10/12, 2009 at 10:15 Comment(0)
S
1

Find the Indy version you are using.Copy the Indy dlls i.e libeay32.dll,libssl32.dll and ssleay32.dll into the Windows/System 32 Folder.It will resolve the error "Could not Load SSL Library"

Saltigrade answered 15/5, 2013 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.