[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, closing the issue then. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ __

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: I think creating an ssl socket from existing socket from an instance generated by library routine, and replace that socket with ssl socket is very common usage. Injecting wrap_socket is very easy. But injecting unwrap call is not easy. In python 2.6, I got a plai

[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The error looks like : SSLError(8, '_ssl.c:1363: EOF occurred in > violation > of protocol') > But why we see "in violation of protocol" here? Because the SSL layer wasn't shutdown cleanly: the TCP connection was closed while the SSL layer was still active. Yo

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: Ah, sorry I understood now. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: The error looks like : SSLError(8, '_ssl.c:1363: EOF occurred in violation of protocol') But why we see "in violation of protocol" here? 2013/4/10 Antoine Pitrou > > Antoine Pitrou added the comment: > > > Client gets an exception in reading the socket, not in

[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > As an interface of ssl socket, server does not have to read, just > write > some data. > The client side should be able to read the bytes that ther server > sent. Please re-read your own code. The server does: +def handle(self): +s

[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali
Charles-François Natali added the comment: > As an interface of ssl socket, server does not have to read, just write > some data. > The client side should be able to read the bytes that ther server sent. The > problem is that client will sometimes raise an unexpected SSLError in > reading the ssl

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: As an interface of ssl socket, server does not have to read, just write some data. The client side should be able to read the bytes that ther server sent. The problem is that client will sometimes raise an unexpected SSLError in reading the ssl socket because serv

[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Client gets an exception in reading the socket, not in writing. Yes, it does, and the exception bears the error code SSL_ERROR_EOF (8), which is expected here. The question is: why would you expect reading *not* to raise an exception while the remote end of

[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali
Charles-François Natali added the comment: > Client gets an exception in reading the socket, not in writing. Please run > the test code and see what happens. Of course it gets ECONNRESET on subsequent recv(), that's how TCP works. Just make your handler read from the socket and it won't happen

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: Client gets an exception in reading the socket, not in writing. Please run the test code and see what happens. 2013/4/9 Charles-François Natali > > Charles-François Natali added the comment: > > > sometimes RST was sent over the network instead of FIN > > Your

[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali
Charles-François Natali added the comment: > sometimes RST was sent over the network instead of FIN Your client sends data, but the server never reads it: when a TCP socket is closed while there's still data in the input socket buffer, a RST is sent instead of a FIN. That's normal behaviour.

[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai
Hiroaki Kawai added the comment: Please run the test so that you'll see the problem. 2013/4/9 Antoine Pitrou > > Antoine Pitrou added the comment: > > I don't think your patch is right: > > - calling unwrap() already shuts down the SSL layer; this is the right way > to do it and is documented

[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think your patch is right: - calling unwrap() already shuts down the SSL layer; this is the right way to do it and is documented as such: "Performs the SSL shutdown handshake, which removes the TLS layer from the underlying socket, and returns the unde

[issue17672] ssl unclean shutdown

2013-04-08 Thread Hiroaki Kawai
Changes by Hiroaki Kawai : -- title: ssl clean shutdown -> ssl unclean shutdown ___ Python tracker ___ ___ Python-bugs-list mailing li