<bdo id='kYABy'></bdo><ul id='kYABy'></ul>

    <small id='kYABy'></small><noframes id='kYABy'>

    <legend id='kYABy'><style id='kYABy'><dir id='kYABy'><q id='kYABy'></q></dir></style></legend>

      <tfoot id='kYABy'></tfoot>
      <i id='kYABy'><tr id='kYABy'><dt id='kYABy'><q id='kYABy'><span id='kYABy'><b id='kYABy'><form id='kYABy'><ins id='kYABy'></ins><ul id='kYABy'></ul><sub id='kYABy'></sub></form><legend id='kYABy'></legend><bdo id='kYABy'><pre id='kYABy'><center id='kYABy'></center></pre></bdo></b><th id='kYABy'></th></span></q></dt></tr></i><div id='kYABy'><tfoot id='kYABy'></tfoot><dl id='kYABy'><fieldset id='kYABy'></fieldset></dl></div>
    1. Hotmail SSL3 版本号错误使用 smtp

      时间:2023-07-02
      <tfoot id='SP1Eq'></tfoot>

        <legend id='SP1Eq'><style id='SP1Eq'><dir id='SP1Eq'><q id='SP1Eq'></q></dir></style></legend>

        <small id='SP1Eq'></small><noframes id='SP1Eq'>

            <tbody id='SP1Eq'></tbody>
          1. <i id='SP1Eq'><tr id='SP1Eq'><dt id='SP1Eq'><q id='SP1Eq'><span id='SP1Eq'><b id='SP1Eq'><form id='SP1Eq'><ins id='SP1Eq'></ins><ul id='SP1Eq'></ul><sub id='SP1Eq'></sub></form><legend id='SP1Eq'></legend><bdo id='SP1Eq'><pre id='SP1Eq'><center id='SP1Eq'></center></pre></bdo></b><th id='SP1Eq'></th></span></q></dt></tr></i><div id='SP1Eq'><tfoot id='SP1Eq'></tfoot><dl id='SP1Eq'><fieldset id='SP1Eq'></fieldset></dl></div>
              <bdo id='SP1Eq'></bdo><ul id='SP1Eq'></ul>
                本文介绍了Hotmail SSL3 版本号错误使用 smtp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试使用 python 中的 hotmail smtp 服务器.但是,我的登录尝试引起了明显的 SSL3 版本号错误.如何更改我正在使用的版本以及如何对此进行调查?

                I am trying to use the hotmail smtp server from python. However, my login attempt gives rise to an apparent SSL3 version number error. How can I change the version I am using and how do I even investigate this?

                >> s.connect('smtp.live.com:587') 
                (220,
                 'BLU0-SMTP46.phx.gbl Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Tue, 2 Jul 2013 12:15:57 -0700')
                >> s.ehlo()
                (250,
                 'BLU0-SMTP46.phx.gbl Hello [123.456.789.01]
                TURN
                SIZE 41943040
                ETRN
                PIPELINING
                DSN
                ENHANCEDSTATUSCODES
                8bitmime
                BINARYMIME
                CHUNKING
                VRFY
                TLS
                STARTTLS
                OK')
                 s.starttls()
                (220, '2.0.0 SMTP server ready')
                >> s.login('my.email@hotmail.com','MyPaSsW0rD')
                ---------------------------------------------------------------------------
                SMTPServerDisconnected                    Traceback (most recent call last)
                <ipython-input-48-c8e9d7577d8d> in <module>()
                ----> 1 s.login('mymemail@hotmail.com','myPassw0rd')
                
                /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.pyc in login(self, user, password)
                    600         elif authmethod == AUTH_PLAIN:
                    601             (code, resp) = self.docmd("AUTH",
                --> 602                 AUTH_PLAIN + " " + encode_plain(user, password))
                    603         elif authmethod == AUTH_LOGIN:
                    604             (code, resp) = self.docmd("AUTH",
                
                /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.pyc in docmd(self, cmd, args)
                    384         """Send a command, and return its response code."""
                    385         self.putcmd(cmd, args)
                --> 386         return self.getreply()
                    387 
                    388     # std smtp commands
                
                /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.pyc in getreply(self)
                    357                 self.close()
                    358                 raise SMTPServerDisconnected("Connection unexpectedly closed: "
                --> 359                                              + str(e))
                    360             if line == '':
                    361                 self.close()
                
                SMTPServerDisconnected: Connection unexpectedly closed: [Errno 1] _ssl.c:1363: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
                

                我的 SSL 版本:

                >> import _ssl
                >> print _ssl.OPENSSL_VERSION
                OpenSSL 1.0.1e 11 Feb 2013
                

                也许这是相关的:Linux上的Python Smtp SSL错误版本

                推荐答案

                我可以用 Python 2.7.3 复制 Debian Wheezy 的问题,它使用与您报告的完全相同的 OpenSSL 版本.我使用 Wireshark 捕获了数据包,并且成功进行了 TLS 握手并交换了一些数据.然而,不久之后,客户端对服务器发送的内容不满意并关闭了连接.

                I can duplicate your problem with Debian Wheezy with Python 2.7.3 which uses the exact same OpenSSL version you report. I captured packets with Wireshark and there is a successful TLS handshake and some data is exchanged. Shortly after that however, the client end gets unhappy with something the server sends and closes the connection.

                我能够通过使用 SSL3 而不是 TLS 来解决这个问题.我不知道如何在 Python 中修补库方法,以便使用它的其他库表现不同,所以我只制作了自己的 smtplib 本地副本.

                I was able to work around the issue by using SSL3 instead of TLS. I couldn't figure out how to patch a library method in Python so that other libraries that used it would behave differently, so I just made my own local copy of smtplib.

                我复制了 2.7 版本的 smtplib(点击原始链接下载)并更改了一行:

                I copied the 2.7 version of smtplib (click on the raw link to download) and changed one line:

                        self.sock = ssl.wrap_socket(self.sock, keyfile, certfile)
                

                        self.sock = ssl.wrap_socket(self.sock, keyfile, certfile, ssl_version=ssl.PROTOCOL_SSLv3)
                

                然后在我的本地目录中编辑文件,我得到:

                Then with the edited file in my local directory I get:

                Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
                [GCC 4.7.2] on linux2
                Type "help", "copyright", "credits" or "license" for more information.
                >>> import smtplib
                >>> s = smtplib.SMTP()
                >>> s.connect('smtp.live.com:587') 
                (220, 'BLU0-SMTP418.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Wed, 3 Jul 2013 09:59:32 -0700')
                >>> s.ehlo()
                (250, 'BLU0-SMTP418.blu0.hotmail.com Hello [24.143.227.254]
                TURN
                SIZE 41943040
                ETRN
                PIPELINING
                DSN
                ENHANCEDSTATUSCODES
                8bitmime
                BINARYMIME
                CHUNKING
                VRFY
                TLS
                STARTTLS
                OK')
                >>> s.starttls()
                (220, '2.0.0 SMTP server ready')
                >>> s.ehlo()
                (250, 'BLU0-SMTP418.blu0.hotmail.com Hello [24.143.227.254]
                TURN
                SIZE 41943040
                ETRN
                PIPELINING
                DSN
                ENHANCEDSTATUSCODES
                8bitmime
                BINARYMIME
                CHUNKING
                VRFY
                AUTH LOGIN PLAIN
                OK')
                >>> s.login('my.email@hotmail.com','MyPaSsW0rD')
                Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                  File "smtplib.py", line 615, in login
                    raise SMTPAuthenticationError(code, resp)
                smtplib.SMTPAuthenticationError: (535, '5.0.0 Authentication Failed')
                >>> 
                

                我没有有效的 Hotmail 帐户,因此无法通过此处,但不再出现 SSL 错误.

                I don't have a valid Hotmail account so I can't get past here, but there is no longer an SSL error.

                这篇关于Hotmail SSL3 版本号错误使用 smtp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:邮件未发送给 CC 中的人 下一篇:SMTP 通过 Exchange 使用 Python 集成 Windows 身份验证 (NTLM)

                相关文章

              • <small id='ZPq91'></small><noframes id='ZPq91'>

                    <bdo id='ZPq91'></bdo><ul id='ZPq91'></ul>

                  1. <tfoot id='ZPq91'></tfoot>
                    <legend id='ZPq91'><style id='ZPq91'><dir id='ZPq91'><q id='ZPq91'></q></dir></style></legend>

                  2. <i id='ZPq91'><tr id='ZPq91'><dt id='ZPq91'><q id='ZPq91'><span id='ZPq91'><b id='ZPq91'><form id='ZPq91'><ins id='ZPq91'></ins><ul id='ZPq91'></ul><sub id='ZPq91'></sub></form><legend id='ZPq91'></legend><bdo id='ZPq91'><pre id='ZPq91'><center id='ZPq91'></center></pre></bdo></b><th id='ZPq91'></th></span></q></dt></tr></i><div id='ZPq91'><tfoot id='ZPq91'></tfoot><dl id='ZPq91'><fieldset id='ZPq91'></fieldset></dl></div>