【问题标题】:.Net FTPS Connection times out after sending 'CCC' command.Net FTPS 连接在发送“CCC”命令后超时
【发布时间】:2014-02-21 10:34:17
【问题描述】:

过去几天我一直在努力使用需要“CCC”命令的 FTPS 服务器,我试图通过 .Net 访问

我正在使用 AlexFTPS 库。我可以连接和协商 AUTH TLS,我可以更改目录,但是当我尝试列出目录或下载文件时,服务器会询问“CCC”命令。当我发送“CCC”命令时,我会收到“200 CCC 上下文已启用”回复,但随后我无法发送任何其他内容,只要我收到服务器超时异常。

我做了进一步的测试:

  • WS_FTP:如果我选中“在 SSL 身份验证后使用未加密的命令通道”选项,则可以使用
  • Filezilla:即使我将“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

谢谢!

【问题讨论】:

    标签: ftp ftps ccc


    【解决方案1】:

    CCC(“清除命令通道”)是一个特殊命令,它将 SSL(以AUTH TLS 开头)的连接再次降级为未加密。因此,仅将其声明为在已建立的控制连接上发送的自定义命令是不够的,它必须由 FTPS 库以类似于AUTH TLS 的方式处理,以便在命令完成后发生 TLS 降级。

    【讨论】:

    • 好的,非常感谢您的帮助!所以我想我将无法用这个 API 处理这个......
    猜你喜欢
    • 2017-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-23
    • 1970-01-01
    • 2012-11-25
    • 1970-01-01
    相关资源
    最近更新 更多