获取SmtpClient使用自签名的SSL证书工作 [英] Getting SmtpClient to work with a self signed SSL certificate

查看:400
本文介绍了获取SmtpClient使用自签名的SSL证书工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使用System.Net.Mail.SmtpClient类通过我公司的邮件服务器转发的电子邮件。到邮件服务器的所有SMTP连接必须是SSL和它使用的自签名的证书。这很好的Outlook在那里你可以单击确定在警告对话,但没有人知道一个办法让SmtpClient接受一个自签名证书?

I'm attempting to use the System.Net.Mail.SmtpClient class to relay an email through my company's email server. All SMTP connections to the mail server have to be SSL and it uses a self signed certificate. That's fine for Outlook where you can just click ok on the warning dialogue but does anyone know a way to get SmtpClient to accept a self signed certificate?

我打算使用Windows Azure平台上的这个程序,所以我将无法安装自签名证书作为信任根。

I'm planning on using this app on the Windows Azure Platform so I won't be able to install the self signed certificate as a trusted root.

推荐答案

我的问题结束了在.NET SmtpClient类显然不支持SMTP SSL连接使用端口465。使用端口25使用自签名证书工作正常。

My issue ended up being that the .Net SmtpClient class apparently doesn't support the use of port 465 for SMTP SSL connections. Using port 25 with a self signed SSL certificate worked correctly.

MSDN论坛System.Net问题的可以SmtpClient配置使用自签名证书的工作?

MSDN System.Net forum question Can SmtpClient be configured to work with a self signed certificate?.

这篇关于获取SmtpClient使用自签名的SSL证书工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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