Daniel Smith <[EMAIL PROTECTED]>: > I've been trying to trace a strange problem here with our mail system. > We have various clients using IMAP over SSL (openssl-0.9.2b) with > stunnel in the middle. [...] > At the top level, stunnel tells me that SSL_accept() returned 0 - no > error set in the ssl libraries however. I think that this 0 means that the connection was closed. This is not treated as an error by OpenSSL even if the handshake did not complete. In any case, you probably should apply the following patch to stunnel.c (as found in stunnel-2.1.tar.gz): --- stunnel.c-ORIG Mon Apr 12 15:39:41 1999 +++ stunnel.c Mon Apr 12 15:44:08 1999 @@ -263,6 +263,7 @@ /* do the job */ ssl=SSL_new(ctx); SSL_set_fd(ssl, s); + SSL_set_accept_state(ssl); if(SSL_accept(ssl)<=0) sslerror("SSL_accept"); #if SSLEAY_VERSION_NUMBER <= 0x0800 ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]