2014-02-21 129 views
2

我一直在掙扎了很多,過去幾天與要求「CCC」命令我通過淨淨FTPS連接時期

試圖訪問一個FTPS服務器我正在使用AlexFTPS庫。我能夠連接並關聯AUTH TLS,我可以更改目錄,但是當我嘗試列出目錄或下載文件時,服務器會要求輸入「CCC」命令。當我發送'CCC'命令時,我得到'200 CCC上下文啓用'回覆,但隨後我無法發送任何其他內容,只要出現服務器超時異常。

我做了進一步的試驗:

  • WS_FTP:作品,如果我檢查選項
  • FileZilla中的「SSL認證後使用未加密的命令通道」:不,即使我加入「CCC」作爲工作一個帖子登錄命令
  • http://www.componentpro.com/ftp.net/:工程,但不是開源

任何幫助,將這麼多的讚賞......對不起,我不FTP流暢...

這裏是我的代碼:

Using Client As New AlexPilotti.FTPS.Client.FTPSClient 

     AddHandler Client.LogCommand, Sub(sender As Object, args As AlexPilotti.FTPS.Common.LogCommandEventArgs) 
              Console.WriteLine(args.CommandText) 
             End Sub 

     AddHandler Client.LogServerReply, Sub(sender As Object, args As AlexPilotti.FTPS.Common.LogServerReplyEventArgs) 
               Console.WriteLine(args.ServerReply) 
              End Sub 

     Dim cred = New Net.NetworkCredential("login", "password") 
     Client.Connect("ftps.server.com", cred, AlexPilotti.FTPS.Client.ESSLSupportMode.CredentialsRequired) 

     Client.SendCustomCommand("SYST") 
     Client.SendCustomCommand("PBSZ 0") 
     Client.SendCustomCommand("PROT P") 
     Client.SendCustomCommand("FEAT") 
     Client.SendCustomCommand("PWD") 
     Client.SendCustomCommand("TYPE A") 
     Client.SendCustomCommand("PASV") 
     Client.SendCustomCommand("CCC") 
     Client.SendCustomCommand("LIST") 

     Console.ReadKey() 

    End Using 

謝謝!

回答

1

CCC(「Clear Command Channel」)是一個特殊的命令,它將連接從SSL(從AUTH TLS開始)降級爲未加密。所以僅僅將它聲明爲一個自定義命令並不足以將其作爲在已建立的控制連接上發送的自定義命令,它必須通過FTPS庫類似於AUTH TLS進行處理,以便在命令完成後發生TLS降級。

+0

好的,非常感謝您的幫助!所以我想我不能用這個API來處理這個... –