小编Jot*_*dan的帖子

使用FluentFTP连接到FTPS(FTP over SSL)

我在本地计算机上使用IIS来测试FTP连接.我正在使用FluentFTP库连接到FTP.我使用以下代码连接到服务器.

FtpClient conn = new FtpClient();
conn.Host = firewallSslDetails.Address;
conn.Credentials = new NetworkCredential(firewallSslDetails.UserName, firewallSslDetails.Password);
conn.SslProtocols = System.Security.Authentication.SslProtocols.Default;

X509Certificate2 cert = new X509Certificate2(@"C:\Users\BizTalk360\Desktop\FtpSites\ServerCert.cer");
conn.EncryptionMode = FtpEncryptionMode.Implicit;
conn.DataConnectionType = FtpDataConnectionType.AutoActive;
conn.DataConnectionEncryption = true;
conn.EnableThreadSafeDataConnections = false;
conn.ClientCertificates.Add(cert);
conn.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);

conn.Connect();
Run Code Online (Sandbox Code Playgroud)

服务器返回我有以下错误.

FluentFTP.FtpCommandException:策略需要SSL.Win32错误:访问被拒绝.错误详细信息:SSL策略要求SSL用于控制通道.

对于通过FTP连接,上面的代码工作正常,对于使用SSL的FTP,它无法正常工作.

c# ftp ssl fluentftp

4
推荐指数
1
解决办法
8368
查看次数

即使配置了 Azure 入站规则和 Windows 防火墙,也无法列出 Azure 上 IIS FTP 服务器上的目录

我在 Azure 中运行 Windows Server 2012,并在 IIS 中配置了 FTP 服务器。当我尝试连接服务器时,它接受用户名和密码并让我登录,但不显示目录列表。

  1. 我试过使用 FileZilla FTP 客户端进行连接,但它说同样的错误。

    Status: Resolving address of jothiprakashanandan.southindia.cloudapp.azure.com
    Status: Connecting to 104.211.244.241:21...
    Status: Connection established, waiting for welcome message...
    Status: Insecure server, it does not support FTP over TLS.
    Status: Logged in
    Status: Retrieving directory listing...
    Command:    PWD
    Response:   257 "/" is current directory.
    Command:    TYPE I
    Response:   200 Type set to I.
    Command:    PASV
    Error:  Connection timed out after 20 seconds of inactivity
    Error:  Failed to retrieve directory …
    Run Code Online (Sandbox Code Playgroud)

iis ftp azure azure-virtual-machine

4
推荐指数
1
解决办法
9203
查看次数

标签 统计

ftp ×2

azure ×1

azure-virtual-machine ×1

c# ×1

fluentftp ×1

iis ×1

ssl ×1