← Back to team overview

pyopenssl-users team mailing list archive

Re: [pyOpenSSL] how to shutdown a socket?

 

On 08/22/2012 10:44 PM, exarkun@xxxxxxxxxxxxxxxxx wrote:
On 07:13 pm, asterix@xxxxxxxxxxx wrote:
Hi,

I'm having problems closing a OpenSSL.SSL.Conection.

Hi Yann,

Perhaps you can explain your goals in a little more detail. "Shutdown"
unfortunately has several possible meanings in the context of an SSL
connection.

It could mean you want to perform an orderly SSL protocol shutdown.
There are two variations of this. You might want to do so without
shutting down the underlying (TCP?) connection. Or you might want to
shut down that underlying connection.

Or it could just mean you want to close the connection, either in an
orderly fashion or otherwise (people tend to be sloppy about closing SSL
connections, particularly when using SSL for HTTPS).

Shutdown and close are also distinct operations when it comes to the
underlying TCP connection. You might want to actually close the
underlying TCP connection, rather than just shutting it down.

So, are any of those close to what you want to do? Please elaborate,
perhaps providing a short, self-contained, complete (minimal) example in
doing so (<http://sscce.org/>).

Also, I have copied the Launchpad user list on this reply, as I would
consider it a great boon if pyOpenSSL eventually completely moved off of
sourceforge, including no longer using the sourceforge hosted mailing
list service.

Hi,

Thanks for your reply.

What I want to do is to completly close the socket.
My application opens a socket, transfer things, and once finished I want to close the socket.

From what I understand I'm supposed to call shutdown() then close() but that doesn't work for me :/

It's hard for me to provide a small example, because haveing non-blocking sockets isn't donein 2 lines :/

--
Yann


Follow ups