[Libevent-users] SSL enabling libevent programs, is there an example available?

2008-01-21 Thread Ron Arts

Hi,

subject says it all. If there's no example with
libevent, can someone recommend another place to look?
I tried Googling but couldn't find a concise example.

Thanks,
Ron


smime.p7s
Description: S/MIME Cryptographic Signature
___
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users


Re: [Libevent-users] SSL enabling libevent programs, is there an example available?

2008-01-21 Thread Thomas Harning

Ron Arts wrote:

Hi,

subject says it all. If there's no example with
libevent, can someone recommend another place to look?
I tried Googling but couldn't find a concise example. 
For example, w/ OpenSSL you can turn the socket to be non-blocking and 
watch for what openssl 'needs' after a failed attempt to read/write...

Ex:
int ret = SSL_read(ssl, buffer, len);
if(ret  0) {
   int err = SSL_get_error(ret);
   switch(err) {
case SSL_ERROR_WANT_WRITE:
   /* Hook up libevent to wait on write then retry w/ exact same 
argument */

   break;
   case SSL_ERROR_WANT_READ:
  /* Hook up libevent to wait on read then ... */
  break;
   default: /* Something else. */
 }
}
___
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users


Re: [Libevent-users] SSL enabling libevent programs, is there an example available?

2008-01-21 Thread William Ahern
On Tue, Jan 22, 2008 at 01:09:11AM +0100, Ron Arts wrote:
 Hi,
 
 subject says it all. If there's no example with
 libevent, can someone recommend another place to look?
 I tried Googling but couldn't find a concise example.
 

http://25thandclement.com/~william/projects/libevnet.html

Download the tarball. OpenSSL bindings are in src/tls.c. There's lots more
code in the library for integrating with libevent, but I wrote tls.c many
years ago (before libevnet, and possibly before libevent), and it should be
easy to rip it out and use however you want.

At the very least, tls_read_try(), tls_write_try() and tls_accept_try()
should help you out.

___
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users