有没有办法可以判断 SMTP 服务器是否期望客户端使用“隐式"连接?SSL 与“显式"SSL?

9

本文介绍了有没有办法可以判断 SMTP 服务器是否期望客户端使用“隐式"连接?SSL 与“显式"SSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

SSL 可以是显式"或隐式",如此链接所述:

SSL can either be "explicit" or "implicit" as explained by this link:

http://help.globalscape.com/help/secureserver2/Explicit_versus_implicit_SS.htm

System.Net.Mail 仅支持显式"SSL,如下所述:

System.Net.Mail only support "explicit" SSL, as explained here:

http://blogs.msdn.com/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx

所以,我正在尝试使用 System.Net.Mail 连接到我无法控制的 SMTP 服务器,但它失败了.我怎么能确定它失败了,因为服务器想要一个隐式"SSL 连接?我可以从客户端进行哪些测试?

So, I'm trying to use System.Net.Mail to connect to an SMTP server that I don't have any control over, and it's failing. How can I know for sure that it's failing because the server wants an "implicit" SSL connection? What test can I do from the client side?

推荐答案

通常这是由约定管理的.在端口 25(正常情况)上运行的 SMTP 使用显式 SSL.在端口 465 上运行的 SMTPS 使用隐式 SSL.在端口 587 上运行的邮件提交使用显式 SSL.

Ordinarily this is governed by convention. SMTP running on port 25 (the normal case) uses explicit SSL. SMTPS running on port 465 uses implicit SSL. Mail submission running on port 587 uses explicit SSL.

为了确定,telnet 到端口,如telnet mail.example.com 25".如果您看到服务器标识自己的纯文本横幅,那么您正在处理显式 SSL.如果您连接成功但什么也看不到,那么您正在处理隐式 SSL.

To tell for sure, telnet to the port, as in "telnet mail.example.com 25". If you see a plain text banner where the server identifies itself, then you are dealing with explicit SSL. If you connect successfully and see nothing, then you are dealing with implicit SSL.

这篇关于有没有办法可以判断 SMTP 服务器是否期望客户端使用“隐式"连接?SSL 与“显式"SSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14

函数委托与函数
Func Delegate vs Function(函数委托与函数)...
2023-11-11 C#/.NET开发问题
6

具有未知类型的 CreateDelegate
CreateDelegate with unknown types(具有未知类型的 CreateDelegate)...
2023-11-11 C#/.NET开发问题
5