Terry
On the client side, I convert back from blocking socket to  n0n-blocking
socket after successfully calling SSL_connect. On the server side, I
call accept(). After accept return socket, put ssl on this socket, then
call SSL_accept(). If SSL_accept() successes, spin off a thread to
handle this new connection. This new connection can be change to
non-blocking if you want too. So one client will be handle by one thread
from server. I hope it help.

TD

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of terry johnston
Sent: Tuesday, January 30, 2007 15:43
To: openssl-users@openssl.org
Subject: RE: openssl with non-blocking comms

hello Thao
Thank you for trying but no, this does not help.

If you want to build a single threaded scalable server using nonblocking
i/o, you need to use exclusively nonblocking i/o. You can't conveniently
block on one connection while it sorts itself out, as you put the other
connections temporarily out of action. This is fine on a single
connection server, but not if you want to support lots of connections.

Thanks anyway.
Terry

On Tue, 30 Jan 2007 14:11:42 -0600, "Dinh, Thao V CIV NSWCDD, K72"
<[EMAIL PROTECTED]> said:
> Terry
> I ran into same problem a while ago. I had a blocking server, waiting 
> for client to connect. I had non-blocking client connected to server, 
> It never pass SSL_connect(). I changed non-blocking to blocking I/O 
> BEFORE I called SSL_connect(). It worked fined. It seem to me you need

> to using blocking socket for SSL_connect to sit there to exchange all 
> the certificate,ciphes.... You can use non-blocking socket for 
> SSL_connect, but you have to put into a loop to call SSL_connect again

> after you received SSL_WANt_READ or SSL_Want _write.
> 
> I hopes it help.
> TD
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of terry johnston
> Sent: Monday, January 29, 2007 16:16
> To: openssl-users@openssl.org
> Subject: openssl with non-blocking comms
> 
> Hello All. I am trying to implement openssl with a server that uses an

> event notification library under Linux. I am using bio pairs to 
> separate the non-blocking comms from the ssl layer. I am currently not

> able to get past the first
> SSL_accept() call.
> 
> Each new client connection does the following...
> 
> - gets accepted normally
> - creates a bio pair
> - sets up read & write event notification
> - receives a read notification - reads data & adds it to the network 
> bio using BIO_write()
> - does a SSL_accept(), which returns -1
> - calls SSL_get_error(), which returns 111 - "not yet implemented"?
> - calls BIO_ctrl_pending() on the network bio, which shows there is 
> nothing to get (presume I would call a BIO_read() to get any data for
> on-sending)
> - adds another read event notification but nothing arrives
> 
> what am I doing wrong?!
> 
> thank you in advance
> Terry Johnston
> --
>   terry johnston
>   [EMAIL PROTECTED]
> 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
--
  terry johnston
  [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to