Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Indy SSL error
| Subject: | Indy SSL error |
| Posted by: | "Koger" (ing..@mail.dk) |
| Date: | 10 May 2006 02:23:22 |
Hello
I have a problem with Indy 9 SSL.
I create a thread, connect to a server using TIdSSLIOHandlerSocket and
call disconnect after 500 ms, while the thread is present here
IdSSLOpenSSL.pas line 1437: error := IdSslConnect(fSSL);
an access violation in the raised. The same things seems to can occur
if I call disconnect while either sending or receiving SSL data
A sample is attached in borland.public.attachments
But I will also paste the code here:
constructor TSSLTestThread.Create;
begin
Socket := TIdTCPClient.Create(nil);
Socket.IOHandler := TIdSSLIOHandlerSocket.Create(Socket);
inherited Create(False);
end;
destructor TSSLTestThread.Destroy;
begin
Socket.Disconnect;
inherited;
Socket.Free;
end;
procedure TSSLTestThread.Execute;
var
SSLHandler: TIdSSLIOHandlerSocket;
begin
SSLHandler := Socket.IOHandler as TIdSSLIOHandlerSocket;
SSLHandler.SSLOptions.Method := sslvSSLv3;
Socket.Host := 'www.microsoft.com';
Socket.Port := 80;
try
Socket.Connect; //Can raise exception, when Socket.Disconnect
called in destructor
except
on E: EIdException do ; //Silent exception
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
while True do
with TSSLTestThread.create do
begin
Sleep(500); //Sleep value might need to be modified
Free;
end;
end;