Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #69982
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!ra.nrl.navy.mil!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail |
|---|---|
| From | Grant Edwards <invalid@invalid.invalid> |
| Newsgroups | comp.lang.python |
| Subject | Re: imaplib: how to specify SSL/TLS protocol version? |
| Date | Wed, 9 Apr 2014 20:55:49 +0000 (UTC) |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Lines | 28 |
| Message-ID | <li4c4l$721$1@reader1.panix.com> (permalink) |
| References | <li49ik$f94$1@reader1.panix.com> <li4a1v$kdo$1@reader1.panix.com> <mailman.9095.1397075591.18130.python-list@python.org> |
| NNTP-Posting-Host | dsl.comtrol.com |
| X-Trace | reader1.panix.com 1397076949 7233 64.122.56.22 (9 Apr 2014 20:55:49 GMT) |
| X-Complaints-To | abuse@panix.com |
| NNTP-Posting-Date | Wed, 9 Apr 2014 20:55:49 +0000 (UTC) |
| User-Agent | slrn/1.0.1 (Linux) |
| Xref | csiph.com comp.lang.python:69982 |
Show key headers only | View raw
On 2014-04-09, Tim Chase <python.list@tim.thechases.com> wrote:
> On 2014-04-09 20:20, Grant Edwards wrote:
>> I'm not too keen on this approach, but monkey-patching the open()
>> method seems to work:
>>
>> def my_imap4_ssl_open(self, host = '', port = 993):
>> self.host = host
>> self.port = port
>> self.sock = socket.create_connection((host, port))
>> self.sslobj = ssl.wrap_socket(self.sock, self.keyfile,
>> self.certfile, ssl_version=ssl.PROTOCOL_TLSv1) self.file =
>> self.sslobj.makefile('rb')
>>
>> imaplib.IMAP4_SSL.open = my_imap4_ssl_open
>
> Our messages passed in the ether.
Yep saw that. Thanks for the answers.
> You don't have to feel dirty for monkey-patching, as you can just do
> it with inheritance.
Doh. I don't know why I didn't think of that...
--
Grant Edwards grant.b.edwards Yow! I wonder if there's
at anything GOOD on tonight?
gmail.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
imaplib: how to specify SSL/TLS protocol version? Grant Edwards <invalid@invalid.invalid> - 2014-04-09 20:12 +0000
Re: imaplib: how to specify SSL/TLS protocol version? Grant Edwards <invalid@invalid.invalid> - 2014-04-09 20:20 +0000
Re: imaplib: how to specify SSL/TLS protocol version? Tim Chase <python.list@tim.thechases.com> - 2014-04-09 15:33 -0500
Re: imaplib: how to specify SSL/TLS protocol version? Grant Edwards <invalid@invalid.invalid> - 2014-04-09 20:55 +0000
Re: imaplib: how to specify SSL/TLS protocol version? Grant Edwards <invalid@invalid.invalid> - 2014-04-09 21:10 +0000
Re: imaplib: how to specify SSL/TLS protocol version? Chris Angelico <rosuav@gmail.com> - 2014-04-10 11:55 +1000
Re: imaplib: how to specify SSL/TLS protocol version? Tim Chase <python.list@tim.thechases.com> - 2014-04-09 15:26 -0500
Re: imaplib: how to specify SSL/TLS protocol version? Antoine Pitrou <solipsis@pitrou.net> - 2014-04-10 19:57 +0000
csiph-web