FTPES

huuuuu21 Messages postés 30 Date d'inscription mercredi 24 septembre 2003 Statut Membre Dernière intervention 8 septembre 2009 - 8 sept. 2009 à 11:04
madflo Messages postés 47 Date d'inscription mercredi 28 juillet 2004 Statut Membre Dernière intervention 24 juin 2013 - 22 sept. 2010 à 21:20
Bonjour à tous,

Je suis en train de pas mal galérer sur un problème que l'on m'a posé au bureau. Je dois réaliser une application .NET qui dépose un fichier sur un serveur FTPS ou FTPES.

Actuellement j'ai un serveur FTPES de test à ma disposition et lorsque je lance ce code :


Public Shared Function ValidateServerCertificate(ByVal sender As Object, ByVal certificate As X509Certificate2, ByVal chain As X509Chain, ByVal sslPolicyErrors__1 As SslPolicyErrors) As Boolean     
    Return True
End Function


Public Shared Sub Upload(ByVal fileName As String, ByVal userFTP As String, ByVal passwordFTP As String, ByVal adresseFTP As String)
        Dim ftpServerIP As String = adresseFTP
        Dim ftpUserID As String = userFTP
        Dim ftpPassword As String = passwordFTP

        'file name of local file
        Dim fileInf As New FileInfo(fileName)
        Dim reqFTP As FtpWebRequest

        'Create FtpWebRequest object from the Uri
        reqFTP = DirectCast(FtpWebRequest.Create(New Uri(("ftp://" & ftpServerIP & "/") + fileInf.Name)), FtpWebRequest)

        'Provide WebPermission Credintials
        reqFTP.Credentials = New NetworkCredential(ftpUserID, ftpPassword)
        'By default KeepAlive is true, control connection is kept alive
        reqFTP.KeepAlive = True

        'Data transfer type.
        reqFTP.UseBinary = False

        'Enable the SSL
        reqFTP.EnableSsl = True

        'passive mode on
        reqFTP.UsePassive = True

        'Set the proxy to nothing
        reqFTP.Proxy = Nothing

        If reqFTP.EnableSsl = True Then
            ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)
        End If

        'Partie Test
        reqFTP.Method = WebRequestMethods.Ftp.ListDirectory
        Dim ResponsFTP As FtpWebResponse = reqFTP.GetResponse

end sub


Ca plante sur cette ligne là => Dim ResponsFTP As FtpWebResponse = reqFTP.GetResponse, il m'envoie une erreur
Le serveur distant a retourné une erreur : (534) 534 Fallback to [C]


Je me dis que c'est peut être parce que uniquement les serveurs FTPS sont gérés et non les serveurs FTPES. Avez déjà eu ce problème, si oui comment l'avez vous résolu ? Sinon avez vous une idée ?

Merci

Hugues Dehen.

1 réponse

madflo Messages postés 47 Date d'inscription mercredi 28 juillet 2004 Statut Membre Dernière intervention 24 juin 2013
22 sept. 2010 à 21:20
Personnellement j'ai le même genre d eproblèmes, j'ai pourtant fais comme vous et j'utilise un ftps en SSL implicite. J'ai une violation de protocole au bout de quelques secondes d'attentes sur un GetStreamResponse :(.
0
Rejoignez-nous