Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: TIdSSLIOHandlerSocketOpenSSL access violation

www.cryer.info
Managed Newsgroup Archive

Re: TIdSSLIOHandlerSocketOpenSSL access violation

Subject:Re: TIdSSLIOHandlerSocketOpenSSL access violation
Posted by:"Hans de Vries" (hans401idonotwantspam@yahoo.com)
Date:Wed, 19 Mar 2008 18:41:17

On Tue, 18 Mar 2008 14:17:13 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

>
>"Hans de Vries" <hans401idonotwantspam@yahoo.com> wrote in message
>news:jpa0u3doa79tiqd17p2thi80pva50gdcpa@4ax.com...
>
>> That should be 10.1.5
>
>That is a very old version.  Try upgrading to the latest 10.2.3 snapshot
>from Indy's website and see if the problem continues.
>
I upgraded to the latest version and it didn't occur anymore! Thanks a
lot.
I succeeded in connecting to and posting through the SSL-mailserver
drooper.mixmin.net, port 465. I used the certificate described here:
http://www.noreply.org/tls/cert-drooper.mixmin.net.ssl.txt

More info about SSL-mailservers can be found here:
http://www.noreply.org/tls/

Still one question though: shouldn't I free the
TIdSSLIOHandlerSocketOpenSSL object assigned to the IOHandler?
Anyway, I did this in the Disconnect method. The code looks like this
right now:

<BEGIN CODE>

  TIdMySmtp = class(TIdTCPClient)
  private
    fThreadId: integer;
    fMixmasterMessIsBeingSent: boolean;
    procedure SendAndWait(aLines: TStringList; aExpectedAnswer:
string);
  public
    procedure Connect; override;
    procedure Disconnect;
    procedure Send(aHeader: TStringList; aBody: TStringList;
aEmailAddress: string; aFromAddressHeader: string);
    property ThreadId: integer read fThreadId write fThreadId;
//    property HeloName: string read fHeloName write fHeloName;
//    property MailFromAddress: string read fMailFromAddress write
fMailFromAddress;
  end;

implementation

{ TIdMySmtp }

uses
  UnitLog;

procedure TIdMySmtp.Connect;
var
  Answer: string;
  Socks: TIdSocksInfo;
begin
  IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(Self);

  Socks := TIdSocksInfo.Create(IOHandler);
  Socks.Version := svSocks4A;
  Socks.Host := '127.0.0.1';
  Socks.Port := 9050;

  with TIdSSLIOHandlerSocketOpenSSL(IOHandler) do
  begin
      TransparentProxy := Socks;
      SSLOptions.CertFile := 'C:\Program
Files\Borland\Delphi7\Projects\AnonPost\cert-drooper_mixmin_net_ssl.txt';
      ReadTimeout := 300000; // 5 minutes
  end;

  inherited;

  Answer := IOHandler.ReadLn;
  fMixmasterMessIsBeingSent := false;
end;

procedure TIdMySmtp.Disconnect;
begin
  TIdSSLIOHandlerSocketOpenSSL(IOHandler).Free;
  inherited;
end;

<END CODE>

It seems to be working fine now. BTW, without the TIdMySmtp.Disconnect
I get an "not Connected" exception when I exit the application.

Is the code above correct? Any comments?

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive