简体   繁体   English

如何验证 FTP 是否支持或需要 SSL 与 C# 中的 FtpWebRequest 连接

[英]How to verify if FTP supports or requires SSL connection with FtpWebRequest in C#

I have an editable FTP URL field that will allow us to pull files from that FTP.我有一个可编辑的 FTP URL 字段,允许我们从 FTP 中提取文件。

Simple FTP: EnableSSL=false (Do not require SSL)简单 FTP:EnableSSL EnableSSL=false (不需要 SSL)

Explicit FTP: EnableSSL=True (Require SSL)显式 FTP:EnableSSL EnableSSL=True (需要 SSL)

How can I know if FTP server supports SSL thru FtpWebRequest library of C#?我如何通过 C# 的FtpWebRequest库知道 FTP 服务器是否支持 SSL? I want to to identify if FTP server supports SSL.我想确定 FTP 服务器是否支持 SSL。

Thank you!谢谢!

The point of SSL/TLS is security. SSL/TLS 的重点是安全性。 If you get attacked, the attacked will hijack the connection and if you allow an unencrypted connection for all your servers, the attacker will obviously make you use it and will steal your credentials.如果你受到攻击,被攻击者将劫持连接,如果你允许所有服务器使用未加密的连接,攻击者显然会让你使用它并窃取你的凭据。 You have to use SSL/TLS straight away, if the server supports it.如果服务器支持,您必须立即使用 SSL/TLS。 And you have to make sure the server is using a trusted certificate.而且您必须确保服务器使用的是受信任的证书。 Otherwise you are not secure.否则你不安全。

Whether your server supports SSL/TLS should be part of the information you get about your FTP server and it should be configured in your code for each of your servers individually.您的服务器是否支持 SSL/TLS 应该是您获得的有关 FTP 服务器的信息的一部分,并且应该在您的代码中为每个服务器单独配置。 That's not something you should be detecting.那不是你应该检测的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM