可以将SmtpClient配置为使用自签名证书吗?

编程入门 行业动态 更新时间:2024-10-26 23:41:51
本文介绍了可以将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跟踪,以便我们可以看到正在发生的事情。请参阅 msdn2.microsoft/en-us/library/ty48b824.aspx &和/或 blogs.msdn/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 msdn2.microsoft/en-us/library/ty48b824.aspxand/or blogs.msdn/dgorti/archive/2005/09/18/471003.aspx

更多推荐

可以将SmtpClient配置为使用自签名证书吗?

本文发布于:2023-08-07 10:22:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:证书   SmtpClient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!