🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #127

Re: Indy and SSL

#127
From: Oleg Tiktinski
Date: Wed, 28 May 2008 21:51
97 lines
3499 bytes
Well it did not help:

delay comes from :

procedure TIdSSLIOHandlerSocketOpenSSL.ConnectClient;
on StartSSL; call

inside StartSSL it calls Init which calls

procedure TIdSSLIOHandlerSocketOpenSSL.Init;
begin
   if not Assigned(fSSLContext) then begin
     fSSLContext := TIdSSLContext.Create;
.
.
.




constructor TIdSSLContext.Create;
begin
   inherited Create;

   if DLLLoadCount <= 0 then begin
   	if not IdSSLOpenSSL.LoadOpenSLLibrary then begin
     	raise 	 
EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary);
     end;
   end;
   Inc(DLLLoadCount);

   fVerifyMode := [];
   fMode := sslmUnassigned;
   fSessionId := 1;
end;

So this line:

IdSSLOpenSSL.LoadOpenSLLibrary takes lots of time to execute. and I do 
that after IdSSLOpenSSLHeaders::Load();

So I am still not sure how to avoid it :(


Oleg Tiktinski wrote:
> Sorry too fast to post I found Load - let me check if it will help.
> 
> 
> Oleg Tiktinski wrote:
>> I am using BCB2007 ( or CodeGear 2007 C++ Builder), Indy10 and I can't 
>> find  IdSSLOpenSSLHeaders.Load();
>>
>> there is file IdSSLOpenSSLHeaders.hpp, but I don't see Load anywhere 
>> there. :(
>>
>>
>>
>> Remy Lebeau (TeamB) wrote:
>>> "Oleg Tiktinski" <oleg@sequoiars.com> wrote in message 
>>> news:483cc31b$1@newsgroups.borland.com...
>>>
>>>> I am using Indy tcp client with SSL
>>>
>>> Which version of Indy are you using?
>>>
>>>> I did some research and find out that on first use
>>>> Indy call LoadSSLLibrary function
>>>
>>> There is no LoadSSLLibrary() function in Indy.  There is a Load() 
>>> function in the IdSSLOpenSSLHeaders unit, though.
>>>
>>>> which do tons of work and slow things down.
>>>
>>> Indy dynamically loads each WinSock DLL function on an as-needed 
>>> basis.  I do not know why Indy never did the same thing with the SSL 
>>> functions.  Most likely to make sure that they are all available 
>>> before allowing any SSL code to run.
>>>
>>>> Did anyone else had this issue ? Any workaround ?
>>>
>>> There is no workaround without re-writing how Indy loads the SSL 
>>> functions internally.
>>>
>>>> Problem is that I can't call this function directly
>>>
>>> Yes, you can.  The IdSSLOpenSSLHeaders.Load() function is publically 
>>> accessible.
>>>
>>>> I have to make FAKE SSL connection in order for Indy to call 
>>>> LoadSSLLibrary.
>>>
>>> No, you don't.
>>>
>>>
>>> Gambit
>>>
Technical Details
Message-ID: <483dd3e1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <483cc31b$1@newsgroups.borland.com> <483daa9d$1@newsgroups.borland.com> <483dcfae$1@newsgroups.borland.com> <483dd005$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a02f5e13cae23a18
X-Google-Attributes: gid11508e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 28 May 2008 14:51:30 -0700
From: Oleg Tiktinski <oleg@sequoiars.com>
User-Agent: Thunderbird 1.5.0.14 (Windows/20071210)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: Indy and SSL
References: <483cc31b$1@newsgroups.borland.com> <483daa9d$1@newsgroups.borland.com> <483dcfae$1@newsgroups.borland.com> <483dd005$1@newsgroups.borland.com>
In-Reply-To: <483dd005$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.4.183.142
Message-ID: <483dd3e1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1212011489 69.4.183.142 (28 May 2008 14:51:29 -0700)
Lines: 97
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail