如何在 C# 中使用 FtpWebRequest 验证 FTP 是否支持或需要 SSL 连接
我有一个可编辑的 FTP URL 字段,允许我们从该 FTP 中提取文件。
简单 FTP:EnableSSL=false
(不需要 SSL)
显式 FTP:EnableSSL=True
(需要 SSL)
我如何知道 FTP 服务器是否通过 FtpWebRequest 支持 SSL
C# 库?我想确定 FTP 服务器是否支持 SSL。
谢谢你!
I have an editable FTP URL field that will allow us to pull files from that FTP.
Simple FTP: EnableSSL=false
(Do not require SSL)
Explicit FTP: EnableSSL=True
(Require SSL)
How can I know if FTP server supports SSL thru FtpWebRequest
library of C#? I want to to identify if FTP server supports SSL.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SSL/TLS 的重点是安全性。如果您受到攻击,被攻击者将劫持连接,如果您允许所有服务器使用未加密的连接,攻击者显然会让您使用它并窃取您的凭据。如果服务器支持的话,您必须立即使用 SSL/TLS。并且您必须确保服务器使用受信任的证书。否则你就不安全。
您的服务器是否支持 SSL/TLS 应该是您获得的有关 FTP 服务器的信息的一部分,并且应该在您的代码中为每个服务器单独配置。这不是你应该检测的东西。
The point of SSL/TLS is security. 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. 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. That's not something you should be detecting.