Erreur de vérification étendue

Résolu
cs_soulama Messages postés 8 Date d'inscription lundi 13 mars 2006 Statut Membre Dernière intervention 7 mai 2007 - 18 oct. 2006 à 00:09
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 - 23 oct. 2006 à 06:07
Salut,


jai ecris un code pour me connecter sur un Serveur FTP, le code marche
bien sur une machine XP, mais sur une machine Win98 jai l'erreur
suivante:


ERangeError: erreur de vérification étendue.


voila mon Code:
function FtpAccess.ConnectToSFTPServer(User, Passwd, Host, Port: String): boolean;
begin
Result:= False ;
SSL:= TIdSSLIOHandlerSocketOpenSSL.Create(FTP);
SSL.ReadTimeout := 60000;
SSL.SSLOptions.Method := sslvSSLv23;
SSL.SSLOptions.Mode := sslmClient;
FTP:= TIdFTP.Create(nil);
FTP.AutoLogin:= True;
FTP.IOHandler := SSL ;
FTP.AutoLogin := True;
FTP.Passive := True;
FTP.UseTLS := utUseExplicitTLS;
FTP.AUTHCmd := tAuthSSL;
FTP.DataPortProtection:= ftpdpsPrivate ;
FTP.Username:= USER;
FTP.Password:= Passwd;
FTP.Host:= HOST;
FTP.Port:= StrToInt(Port) ;
FTP.Disconnect ;
Try
FTP.Connect ;
Result:= True ;
Excepton E:Exception do
Begin
MyDataModule.AddToFtpLog('ERROR Func ConnectToSFTPServer', E.Message);
MyDataModule.Log('ERROR Func ConnectToSFTPServer',E.className+' ' +E.Message);
end ;
End ;
end;



je suis sur Delphi 7, et indy 10.


Merci pr toute info,

4 réponses

f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
18 oct. 2006 à 01:49
var
FTP : TIdFTP = nil;
SSL : TIdSSLIOHandlerSocketOpenSSL = nil;

function FtpAccess.DisconnectFTP : boolean;
begin
if Assigned(FTP) then begin
FTP.disconnect;
FreeAndNil(FTP);
end;
if Assigned(SSL) then
FreeAndNil(SSL);
end;

function FtpAccess.ConnectToSFTPServer(User, Passwd, Host, Port: String): boolean;
begin
Result:= False ;

if not Assigned(FTP) then
FTP := TIdFTP.Create(self);

if not Assigned(SSL) then
SSL := TIdSSLIOHandlerSocketOpenSSL.Create(FTP);

with SSL do begin
ReadTimeout := 60000; // attention si c'est en seconde ou milliseconde
SSLOptions.Method := sslvSSLv23;
SSLOptions.Mode := sslmClient;
end;

with FTP do begin
AutoLogin := True;
IOHandler := SSL;
AutoLogin := True;
Passive := True;
UseTLS := utUseExplicitTLS;
AUTHCmd := tAuthSSL;
DataPortProtection:= ftpdpsPrivate;
Username := User;
Password := Passwd;
Host := Host;
Port := StrToIntDef(Port,21); // on utilise StrToIntDef au cas ou
end;
Try
FTP.Connect;
Result:= FTP.Connected;
Except
on E : Exception do Begin
MyDataModule.AddToFtpLog('ERROR Func ConnectToSFTPServer', E.Message);
MyDataModule.Log('ERROR Func ConnectToSFTPServer',E.className+' ' +E.Message);
end;
end;
end;



aprés il se peut que les api FTP/Socket soit differente Indy pour XP et indy pour 98 ... sans parler des differences enorme de systeme.
mais qui utilise encore windows 98 ?

1
Rejoignez-nous