可以将SmtpClient配置为使用自签名证书吗? [英] Can SmtpClient be configured to work with a self signed certificate?

查看:133
本文介绍了可以将SmtpClient配置为使用自签名证书吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图通过我公司的电子邮件服务器转发电子邮件。服务器将SSL与自签名证书一起使用。当我尝试使用SmtpClient发送时,我得到以下例外:

"无法从传输连接中读取数据:net_io_connectionclosed。"

我已尝试挂钩ServicePointManager.ServerCertificateValidationCallback事件,但我没有得到回调。

问候,

亚伦

Hi,

I'm attempting to relay an email through my company's emails server. The server uses SSL with a self signed certificate. When I attempt to send with SmtpClient I get an exception of:

"Unable to read data from the transport connection: net_io_connectionclosed."

I've tried hooking the ServicePointManager.ServerCertificateValidationCallback event but I don't get a callback.

Regards,

Aaron

推荐答案

我认为它应该没问题。

看起来远程端只是在收到它不喜欢的东西时关闭连接。 您是否可以启用System.Net跟踪,以便我们可以看到正在发生的事情。 请参阅 http://msdn2.microsoft.com/en-us/library/ty48b824.aspx &和/或 http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx
I'd have thought it should be ok.

Looks like the remote end is just closing the connection when it gets something it doesn't like.  Can you enable System.Net tracing so that we can see what is going on.  See see http://msdn2.microsoft.com/en-us/library/ty48b824.aspx and/or http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx


这篇关于可以将SmtpClient配置为使用自签名证书吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆