This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients Arfrever, flox, giampaolo.rodola, janssen, jcea, pitrou, vstinner
Date 2010-04-06.11:43:08
SpamBayes Score 1.110223e-16
Marked as misclassified No
Message-id <1270554191.85.0.178087480902.issue8108@psf.upfronthosting.co.za>
In-reply-to
Content
> By the way, this "broken pipe" error could be due to the fact that the
> FTP_TLS client never tries to call unwrap() on its SSL socket. Perhaps
> the close() method should be overriden?

ftplib.FTP_TLS class already calls unwrap() but only when closing a "secured" *data* connection.
This is never done for the *control* connection as the examples shown in RFC-4217 do that only when dealing with the CCC command which is intended to switch the control connection back to clear text.
Since ftplib.py does not implement the CCC command I would avoid to override its close() method.

As for our test server we are currently shutting down the SSL layer for both connections (control and data) so this might be the cause of EPIPE.
At this proposal I suggest to move the shutdown() call from SSLConnection.handle_close() to DummyTLS_DTPHandler.handle_close() and see what happens.
If EPIPE keeps being raised then I would investigate on what EPIPE means in terms of OpenSSL itself. It might mean that the socket is supposed to be closed in which case it's perfectly legitimate.

I'd have a few questions:

> a workaround for the strange SSL_shutdown() error return, also
> witnessed by LightHTTPd users (see URL in comments)

What happens now? I mean... what do we get instead of socket.error: 0?

> an auto-retry for SSLSocket.unwrap() in blocking mode

Wasn't SSL_MODE_AUTO_RETRY option applied in issue 8222 supposed to already do that for us?

> I think the SSL_shutdown() issue should be checked on the OpenSSL 
> mailing-list.

If socket.error: 0 comes from OpenSSL then yes. I was suspecting something like this.
History
Date User Action Args
2010-04-06 11:43:11giampaolo.rodolasetrecipients: + giampaolo.rodola, jcea, janssen, pitrou, vstinner, Arfrever, flox
2010-04-06 11:43:11giampaolo.rodolasetmessageid: <1270554191.85.0.178087480902.issue8108@psf.upfronthosting.co.za>
2010-04-06 11:43:09giampaolo.rodolalinkissue8108 messages
2010-04-06 11:43:08giampaolo.rodolacreate