简体   繁体   English

iOS SSL握手失败

[英]iOS SSL handshake failed

I am trying to use SMTP to send email in my app without using iOS default mail system. 我正在尝试使用SMTP在我的应用程序中发送电子邮件,而不使用iOS默认邮件系统。 However, I receive an SSL handshake failed info. 但是,我收到SSL握手失败的信息。 Does that mean the SMTP server I am trying to use forbid my request? 这是否意味着我要使用的SMTP服务器禁止我的请求? Any advice will be appreciated. 任何建议将被认真考虑。

2014-07-03 18:04:20.266 MGM[267:4503] C: Attempting to connect to server at: smtp.apps1010.com:25
2014-07-03 18:04:20.360 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.361 MGM[267:60b] S: 220 pan.communilink.net ESMTP
2014-07-03 18:04:20.361 MGM[267:60b] C: EHLO localhost

2014-07-03 18:04:20.362 MGM[267:60b] *** starting short watchdog ***
2014-07-03 18:04:20.370 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.370 MGM[267:60b] S: 250-pan.communilink.net
2014-07-03 18:04:20.377 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.377 MGM[267:60b] S: 250-STARTTLS
2014-07-03 18:04:20.378 MGM[267:60b] C: STARTTLS

2014-07-03 18:04:20.378 MGM[267:60b] *** starting short watchdog ***
2014-07-03 18:04:20.379 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.379 MGM[267:60b] S: 250-PIPELINING
2014-07-03 18:04:20.380 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.381 MGM[267:60b] S: 250-8BITMIME
2014-07-03 18:04:20.381 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.381 MGM[267:60b] S: 250-SIZE 68000000
2014-07-03 18:04:20.382 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.382 MGM[267:60b] S: 250 AUTH LOGIN PLAIN CRAM-MD5
2014-07-03 18:04:20.386 MGM[267:60b] *** stopping watchdog ***
2014-07-03 18:04:20.386 MGM[267:60b] S: 220 Proceed.
2014-07-03 18:04:20.387 MGM[267:60b] Beginning TLSv1...
2014-07-03 18:04:20.388 MGM[267:60b] C: EHLO localhost

2014-07-03 18:04:21.026 MGM[267:60b] CFNetwork SSLHandshake failed (-9807)

Before you send STARTTLS you have to make sure, that you've read the full response from the server to the latest command - in this case this would be EHLO which ends with 250 AUTH.. . 在发送STARTTLS之前,您必须确保已经阅读了从服务器到最新命令的完整响应-在这种情况下,这将是EHLO,以250 AUTH..结尾。 After you've send your STARTTLS command you need to wait for the response from the server ( 220 Proceed ) and only after you got the successful response you should start with the TLS handshake. 发送STARTTLS命令后,您需要等待服务器的响应( 220 Proceed ),只有获得成功的响应后,才应从TLS握手开始。 And only after the handshake is done you should continue with sending commands inside the encrypted connection. 并且只有在完成握手之后,您才应该继续在加密连接内发送命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM