How to avoid blocking in socket.ssl() ?

C

Claudio

Hi,

I am trying to incorporate support for SSL in an
existing Python TCP/IP client program so it could
connect to an SSL server. Both the client and server
uses a proprietary protocol.

This client program uses asyncore because it could not
block in any way and it does not use threads.
After the client connects to the server,
I use 'socket.ssl(...)' to initiate the SSL connection.
If the server is ready to accept SSL connections,
'socket.ssl()' returns quick enough, but if the
server does not accept SSL connections
socket.ssl() blocks for a long time...
(I waited several minutes and it didn't return).
Is there anyway to avoid blocking in socket.ssl()
and return an error in this situation ?

I am using the native support of SSL in Python 2.3.2
using Linux 2.4.20 but the client will have to
run in Windows also.

Regards,
Claudio L. S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top