smtp.live.com和TIdSmtp(Indy,Delphi)的SSL支持 [英] SSL support for smtp.live.com and TIdSmtp (Indy, Delphi)

查看:635
本文介绍了smtp.live.com和TIdSmtp(Indy,Delphi)的SSL支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接smtp.live.com发送电子邮件(live.com支持自2009年以来的免费pop3 / smtp,但这完全是我的消息。)

I am trying to connect to smtp.live.com to send emails (live.com supports free pop3/smtp since 2009 apparently but this is totally news for me).

当我尝试连接到smtp.live.com端口587时,会发生什么:

Here is what happens when I try to connect to smtp.live.com port 587:

Method sslvSSLv2  - timeout (obviously the server does not support SSL2)
Method sslvSSLv3  - Error connecting with SSL. - error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
Method sslvSSLv23 - Error connecting with SSL. - error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Method sslvTLSv1  - Error connecting with SSL. - error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

我使用与sslvSSLv23相同的代码sslvTLSv1,它可以正常使用gmail smtp(smtp.gmail.com,端口465)服务器。另外,当检查SSL时,Outlook会正常发送邮件,并且在587端口上可能会与OpenSSL相关。任何人都可以帮助我这个谜?我想要设置某些东西?

I use the same code with sslvSSLv23 and sslvTLSv1 and it works normally with gmail smtp (smtp.gmail.com, port 465) server. Also, Outlook sends mails normally when SSL is checked and on port 587 so it may be something related to OpenSSL. Can anyone help me with this mystery? Did I missed to set something?

推荐答案

像GMail一样,Live.com的端口587要求客户端连接未加密,并发送 STARTTLS 命令,然后启动SSL / TLS握手。在Indy 10中,您可以在连接之前将 TIdSMTP.UseTLS 属性设置为 utUseExplicitTLS 。这听起来像是你的 UseTLS 属性设置为 utUseImplicitTLS (这是GMail端口465所需要的)。

Like GMail, Live.com's port 587 requires the client to connect unencrypted and send a STARTTLS command before then initiating an SSL/TLS handshake. In Indy 10, you do that by setting the TIdSMTP.UseTLS property to utUseExplicitTLS before connecting. It sounds like you have the UseTLS property set to utUseImplicitTLS instead (which is what is needed for GMail port 465).

这篇关于smtp.live.com和TIdSmtp(Indy,Delphi)的SSL支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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