[issue1251] ssl module doesn't support non-blocking handshakes

2012-06-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: [...] > > Should this Issue be reopened or should I file a new Issue? I would prefer a new issue to be filed (assuming the error happens again). -- ___ Python tracker ___

[issue1251] ssl module doesn't support non-blocking handshakes

2012-06-28 Thread Michael Gundlach
Michael Gundlach added the comment: I recently started getting what appears to be this bug in 2.6.6 and 2.7.3 when connecting to Google. My script does this: while True: get an IMAP connection to Google, if our old one timed out fetch unread messages. if any: make an SMTP con

[issue1251] ssl module doesn't support non-blocking handshakes

2010-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: do_handshake() not respecting the socket timeout was fixed in r80452. -- nosy: +pitrou resolution: -> fixed status: open -> closed ___ Python tracker _

[issue1251] ssl module doesn't support non-blocking handshakes

2009-01-13 Thread Bill Janssen
Bill Janssen added the comment: Well, maybe he found something -- never reported back. But it was a few months ago... I'm in no hurry to close it, though. ___ Python tracker ___ ___

[issue1251] ssl module doesn't support non-blocking handshakes

2009-01-10 Thread Facundo Batista
Facundo Batista added the comment: Bill, should this issue be closed? Or Senthil found a bug in the actual code and you're waiting for him to point out where is the problem or a way to reproduce it? -- nosy: +facundobatista ___ Python tracker

[issue1251] ssl module doesn't support non-blocking handshakes

2008-09-03 Thread Bill Janssen
Bill Janssen <[EMAIL PROTECTED]> added the comment: Thanks. If you can identify a specific bug, I'll take a look at it. ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue1251] ssl module doesn't support non-blocking handshakes

2008-09-02 Thread Senthil
Senthil <[EMAIL PROTECTED]> added the comment: Yes Janssen, I checked again and found it implemented in both trunk (py26) and py3k. All the tests pass as well. However, in one of my testcases for issue1424152, where I expected the timeout to happen for do_handshake(), it did not take effect. I

[issue1251] ssl module doesn't support non-blocking handshakes

2008-09-01 Thread Bill Janssen
Changes by Bill Janssen <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10337/unnamed ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue1251] ssl module doesn't support non-blocking handshakes

2008-09-01 Thread Bill Janssen
Bill Janssen <[EMAIL PROTECTED]> added the comment: I believe this is now implemented in all the branches. And when I run the tests, they run fine. There's still an issue with unwrap; it does a blocking tear-down of the SSL session, and can block when you don't want it to. I'll have to look

[issue1251] ssl module doesn't support non-blocking handshakes

2008-09-01 Thread Senthil
Senthil <[EMAIL PROTECTED]> added the comment: This issue is yet not fixed for both Py2.6 and Py3k. The tests which are present in code are not run (or disabled) in test_ssl.py I understand, customers have a good chance of hitting upon this issue. When ssl do_handshake() does not timeout and app

[issue1251] ssl module doesn't support non-blocking handshakes

2008-05-16 Thread Jesús Cea Avión
Jesús Cea Avión <[EMAIL PROTECTED]> added the comment: Thanks, Bill. I was reading 2.6 preview documentation, and nothing is said there. __ Tracker <[EMAIL PROTECTED]> __ __

[issue1251] ssl module doesn't support non-blocking handshakes

2008-05-15 Thread Bill Janssen
Bill Janssen <[EMAIL PROTECTED]> added the comment: Here's what's in the 3.0 docs: The parameter do_handshake_on_connect specifies whether to do the SSL handshake automatically after doing a socket.connect(), or whether the application program will call it explicitly, by invoking the SSLSocket.d

[issue1251] ssl module doesn't support non-blocking handshakes

2008-05-15 Thread Jesús Cea Avión
Jesús Cea Avión <[EMAIL PROTECTED]> added the comment: I'm hitting this issue aswell. How is going?. I'm creating a socket with a, let say, 5 seconds timeout. The timeout works fine before the "wrap_socket()", and after it. But the timeout doesn't work WHILE in the "wrap_socket()" method call.

[issue1251] ssl module doesn't support non-blocking handshakes

2008-05-15 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1251] ssl module doesn't support non-blocking handshakes

2008-03-18 Thread Bill Janssen
Bill Janssen <[EMAIL PROTECTED]> added the comment: I'm working on it. I'll close it when it's finished. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bu

[issue1251] ssl module doesn't support non-blocking handshakes

2008-03-17 Thread Sean Reifschneider
Sean Reifschneider <[EMAIL PROTECTED]> added the comment: Should this be back-ported to 2.6, or can it be closed? -- keywords: +patch nosy: +jafo priority: -> normal __ Tracker <[EMAIL PROTECTED]> __

[issue1251] ssl module doesn't support non-blocking handshakes

2007-12-12 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola': -- nosy: +giampaolo.rodola __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1251] ssl module doesn't support non-blocking handshakes

2007-11-17 Thread Bill Janssen
Bill Janssen added the comment: This is now checked into the 3K branch. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Bill Janssen
Bill Janssen added the comment: "You seem to be missing the whole point of doing non-blocking I/O," You know, I think that's right. I'm so used to using threads by now that the whole select-based approach seems very odd to me by now. OK, I've folded your patch into the PyPI version, ssl 1.8.

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Chris Stawarz
Chris Stawarz added the comment: Bill, You seem to be missing the whole point of doing non-blocking I/O, which is to handle multiple concurrent, I/O-bound tasks in a single OS thread. The application must be able to try the handshake, detect that it didn't complete because I/O needs to ta

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Bill Janssen
Bill Janssen added the comment: Perhaps we shouldn't expose this at the application level. We could check, in the C module's sslwrap, whether the socket is blocking or not, and do the right thing there, so that sslwrap would always succeed in one call. Since we are releasing the GIL whenever

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-13 Thread Bill Janssen
Bill Janssen added the comment: It's my mistake; I was looking at too many patches at the same time. Thanks for the example. Bill __ Tracker <[EMAIL PROTECTED]> __

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-12 Thread Chris Stawarz
Chris Stawarz added the comment: > The loop in _ssl.c/do_handshake will never return WANT_READ or > WANT_WRITE, so the loop in the test case, for instance, is > unnecessary. I don't know why you think that, but it's easy enough to show that this statement is incorrect. I've attached two scr

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-12 Thread Bill Janssen
Bill Janssen added the comment: Chris, Looking at this a bit harder, I don't see that it accomplishes much. The loop in _ssl.c/do_handshake will never return WANT_READ or WANT_WRITE, so the loop in the test case, for instance, is unnecessary. The original code handled the non-blocking case

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Bill Janssen
Bill Janssen added the comment: Yes, that's correct. I've reviewed your patch, and it looks OK to me. I'll fold it in in the next go-around, once I've made some progress on the asyncore issues. __ Tracker <[EMAIL PROTECTED]> _

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Chris Stawarz
Chris Stawarz added the comment: I meant that SSL-wrapped sockets must be set non-blocking in the case where you want to do non-blocking I/O with them using select(). This is another difference between SSL-wrapped sockets and normal sockets. With a normal socket, as long as you use select

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Bill Janssen
Bill Janssen added the comment: "SSL-wrapped sockets *must* be set non-blocking." Can you say a bit more about why? __ Tracker <[EMAIL PROTECTED]> __ __

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Guido van Rossum
Changes by Guido van Rossum: -- nosy: -gvanrossum __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Chris Stawarz
Chris Stawarz added the comment: Yeah, the pattern for doing non-blocking I/O with select() is different for SSL-wrapped sockets: You always have to try the potentially-blocking operation first, and then call select() and retry in response to SSL_ERROR_WANT_READ/WRITE. (You can also check

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-10 Thread Bill Janssen
Bill Janssen added the comment: The larger problem here is that straightforward select() just doesn't work with SSL-wrapped sockets. If you depend on it for liveness, your program will eventually hang up. When packets in SSL arrive at a destination, they are pulled off the socket in chunks o

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-09 Thread Bill Janssen
Bill Janssen added the comment: By a bit of synchronicity, I've been looking at non-blocking SSL issues all day. Thanks, Chris. I'll take a look and fold it in. There are a number of other issues here, too, such as changing the socket's blocking- ness after it's wrapped (which asyncore does)

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: Assigning to Bill Janssen. -- assignee: -> janssen nosy: +gvanrossum, janssen __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-09 Thread Chris Stawarz
New submission from Chris Stawarz: The current version of the ssl module doesn't support non-blocking creation of SSLSocket objects. The reason for this is that the SSL handshaking (SSL_connect/SSL_accept) takes place during the construction of the SSLContext object (in newPySSLObject). This me