Initial ssl connection problem


(AndreasP) #1

At design time I got no problem to connect to a relativity server via https://inv…com/bin, recieving design time data etc.

At runtime first I got a EIdOSSLCouldNotLoadSSLLibrary exception (“could not load ssl lib”) and after I put libeasy32.dll and ssleay.dll in the same exe dir I got a SessionNotFoundException (“Session could not be found”).

To connect I only use a TDARemoteDataAdapter and and set wired TDAMemDataTable.Active := True.

What do I have to do to get it working? What’s the difference between design time and runtime setup and how I get rid of this ssl thing?

Thank you.

(EvgenyK) #3


SessionNotFoundException exception is our exception that means that you have successfully connected to server via https:// .
as a workaround, you should perform login to Relativity server.

Have you used our DAD wizard?
if yes, it already performs login in ClientChannel_OnLoginNeeded event if SessionNotFoundException was raised on server so you can ignore this exception.

(AndreasP) #4

Thank you for responding.

I see there is more than one problem for me in this thread. Already found that SessionNotFoundExceptionis apearing only once.

  1. No I don’t use your DAD wizard as I switch a given app from local db to relativity. There is no interactive login. I only provide credentials as TDARemoteDataAdapter.LoginString. How to provide a “login to Relativity server” to avoid SessionNotFoundException (BTW, it is happened via plain http://, too)?

  2. If I use a https:// connection I got a runtime error (missing ssl lib). How do I avoid providing ssl dll? If I connect to relativity server (https:/…/bin) in browser it seemed I got xml data without any ssl lib.

My requirements are very basic. I only search for a good aproach for wiring all the things up and running.


(EvgenyK) #5

pls review our DA samples, they do connect to Relativity via RDA, like:

  lRemoteDataAdapter.DataServiceName := 'DataService';
  lRemoteDataAdapter.LoginServiceName := 'LoginService';
  lRemoteDataAdapter.LoginString := 'User Id="simple";Password="simple";Domain="DASamples";Schema="Simple"';
  lRemoteDataAdapter.TargetURL := 'http://localhost:7099/bin';

yep, Relativity always requires login

By default, Indy components are used for https:// connection. they require libeasy32.dll and ssleay.dll libraries.
Your browser may use own ssl libraries.

You can use WinInet channel. in this case, SSL libraries aren’t required, but you have to use “full” version components:

  • TROBinMessage
  • TROWinInetHTTPChannel
  • TRORemoteService

and code:

//  lChannel : TROWinInetHTTPChannel
  lChannel.TargetURL := 'http://localhost:7099/bin';
//  lMessage : TROBinMessage
//  lRemoteService : TRORemoteService
  lRemoteService.Channel := lChannel;
  lRemoteService.Message := lMessage;
  lRemoteService.ServiceName := 'DataService';
  if (TBaseLoginService_Proxy.Create('LoginService', lMessage, lChannel) as IBaseLoginService).LoginEx(UTF8Encode('User Id="simple";Password="simple";Domain="DASamples";Schema="Simple"')) then begin
    Log('Login has been successfull. Going further...');
  else begin
    Log('Unsuccessful login. Please check your login and password. Exiting...');

  RemoteDataAdapter.RemoteService := lRemoteService;
  Table.RemoteDataAdapter := RemoteDataAdapter; 

(AndreasP) #6

I got it working. Thank you very much.