是否.NET的FtpWebRequest同时支持隐式(FTPS)和显式(FTPES)?隐式、FtpWebRequest、NET、FTPS

2023-09-02 01:46:13 作者:自卑無言以對

我被要求支持隐性和显性FTPS(也称为FTPES)。目前,我们正在使用.NET的FtpWebRequest。是否的FtpWebRequest支持这两种类型FTPES的,又有什么区别。

I am being asked to support implicit and explicit FTPS (also known as FTPES). We are currently using the .NET FTPWebRequest. Does the FTPWebRequest support both types of FTPES, and what is the difference.

感谢

推荐答案

据我所知,目前(.NET 2.0和3.5)版本的FtpWebRequest的支持显式SSL只。

as far as I know the current (.NET 2.0 and 3.5) version of FtpWebRequest supports Explicit SSL only.

其实,.NET 2.0目前不   支持隐式SSL,只有明确。   我们会考虑加入这一个   未来的版本。

Actually, .NET 2.0 does not currently support implicit SSL, only explicit. We will consider adding this for a future release.

JonCole - MSFTModerator在MSDN论坛帖子

JonCole - MSFTModerator at MSDN forum post

如果您需要同时使用隐式和显式TLS / SSL,你一定要试试第三方的FTP / SSL的组成部分之一。继code使用我们的 Rebex的FTP / SSL 并取自tutorial页。

If you need to use both Implict and Explicit TLS/SSL you have to try one of third-party FTP/SSL components. Following code uses our Rebex FTP/SSL and is taken from the tutorial page.

明确TLS / SSL

客户端连接到FTP服务器通常不受保护的方式,通常是21端口被分配到FTP协议。当希望保护使用SSL连接,一个SSL协商被初始化时,控制连接被固定,所有的其它的通信被保护

Client connects to FTP server in a usual non-protected way, usually to port 21 was assigned to FTP protocol. When it is desired to protect the connection using SSL, an SSL negotiation is initialized, control connection is secured and all following communication is being protected.

// Create an instance of the Ftp class. 
Ftp ftp = new Ftp();

// Connect securely using explicit SSL. 
// Use the third argument to specify additional SSL parameters. 
ftp.Connect(hostname, 21, null, FtpSecurity.Explicit);

// Connection is protected now, we can log in safely. 
ftp.Login(username, password);

显式保护装置,它可以保证在任何时刻的连接。如果你不知道你是否需要在没有保护的连接时,您可能需要连接使用普通的未加密的FTP协议和今后的安全连接。

Explicit protection means that it is possible to secure the connection at any moment. If you don't know whether you will need the protection on not at the connection time, you might want to connect using the ordinary unencrypted FTP protocol and secure the connection later.

Ftp ftp = new Ftp();

// Connect to the server with no protection. 
ftp.Connect(hostname, 21);

// Upgrade connection to SSL. 
// This method also accepts an argument to specify SSL parameters. 
ftp.Secure();

// Connection is protected now, we can log in safely. 
ftp.Login(username, password);

在FTP会话隐式SSL保护

FTPS协议最初被分配一个独立的端口由IANA。当连接到这个端口,SSL协议将立即启动和控制连接是安全的。所有数据连接都以相同的方式也获得隐。这类似于使用HTTPS的方法

FTPS protocol was originally assigned a separate port by the IANA. Upon connection to this port, an SSL negotiation starts immediately and the control connection is secured. All data connections are also secured implicitly in the same way. This is similar to the approach used by HTTPS.

这方法不是由IETF的青睐,是pcated德$ P $。它是由Rebex的FTP / SSL与旧服务器的互操作性支持,但强烈建议使用显式的保护,而不是只要有可能。

This approach is not favored by the IETF and is deprecated. It is supported by Rebex FTP/SSL for interoperability with older servers, but it is strongly recommended to use the explicit protection instead whenever possible.

Ftp ftp = new Ftp();

// Connect securely using implicit SSL. 
// Use the third argument to specify additional SSL parameters. 
ftp.Connect(hostname, 990, null, FtpSecurity.Implicit);

// Connection is protected now, we can log in safely. 
ftp.Login(username, password);

您可以下载分量 rebex.net/ftp-ssl.net/