Hi, On Mon, Nov 16, 2009 at 6:19 PM, TheSquad <msega...@me.com> wrote: > > Hello everyone, > > I have multithreaded the Handshake of SSL by creating a thread after each > connection to my server. > the handshake is done on a separate thread. > So there is two question poping up :
There's a thread about multithreading here: http://marc.info/?l=openssl-users&m=125744808715652&w=2 And the related answers to your question of tha thread here: http://marc.info/?l=openssl-users&m=125747020117320&w=2 > 1 - How come if I connect to my server with telnet without SSL support, the > socket hang indefinitely looking for a initiated handshake from the client. > Is there a way to timeout blocking socket without alarm ? You will need to use non-blocking bio. If you are programming in C, you can use select() for using a timeout value. Or, you can make something more ugly that is count tries in a cycle with a sleep() inside (the factor tries*sleeped-second will count as a timeout). > 2 - How come when one thread is blocked by SSL_accept, every NEW thread are > also blocked at SSL_accept waiting for the blocking thread to timeout ? You may find an answer in the above link. If you are using ssl_accept on the same structure this will fail unexpectedly. And if you don't, the same thing can happen, as you may be modifying internal OpenSSL structures in each call despite you are using differents ssl structure for each connection. So, in any approach you will get a crash eventually. > Any help would be appreciated ! We have looked everywhere for a few days, > and we can't understand how fix it. > Thank you all. There's a book you can read (chapter 4 and chapter 5) with an old openssl version, but the very basics are there. It's called "Network Security wiht OpenSSL", by O'Reilly. You can check out what we're working on. It's not ready and it's on development, but it's open source. It's a multithreaded server with a thread per client (with a max of 32 clients). It's bugged until now but maybe you can find some examples on it. (I'm not a developer, just cs student). http://code.google.com/p/tellapic/source/browse/trunk/server.c Regards, -- If you want freedom, compile the source. Get gentoo. Sebastián Treu http://labombiya.com.ar ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org