Thank you Dave for your response.
Let me try using SSL_get_error() as you described to see what information it gives me.
-sal

--------------------------------------------------
From: "Dave Thompson" <[email protected]>
Sent: Friday, December 04, 2009 7:58 PM
To: <[email protected]>
Subject: RE: openssl-0.9.8a - Why does the UNIX process display [error:00000000:lib(0):func(0):reason(0)]?

From: [email protected] On Behalf Of Salvatore DeGrezia
Sent: Thursday, 03 December, 2009 15:05

I have written a simple Winform application (based on .NET Framework
2.0) that
tries to establish an SSL connection with a server-side UNIX (SunOS
version 5.10) process
that is using openssl-0.9.8a. When i run the application, the UNIX
process
displays the following message
"[error:00000000:lib(0):func(0):reason(0)]"
when it calls the SSL_accept() call.
<snip>
int err = SSL_accept((SSL *)SockObj->SSLCtx);
...

SSL_accept() itself should not display anything (in a normal build).
There must be some code in your "..." (or later) that displays this.

If it is trying to decode-and-display the returned value from SSL_accept(), i.e. the value in err, that is wrong, and could produce this useless result.

After a <=0 return from SSL_accept (and several other, see the man page)
your code should call SSL_get_error() to determine whether this was:

- a protocol error (SSL_ERROR_SSL) in which case you should display
the OpenSSL error queue (call ERR_get_error, preferably decode and
display the result, loop until zero; or just call ERR_print_errors*)

- an underlying communications error (SSL_ERROR_SYSCALL) in which case
the man page says there *may* be an error queue (but I've never seen it)
and if not you should display the (real operation) return value and
Unix errno (preferably explained with perror() or strerror() etc.)
(or Windows WSAGetLastError(), not quite as easy to explain)

- a nonblocking operation that needs to be rescheduled (SSL_WANT_READ etc.) but if you are using nonblocking and your code doesn't already handle these
it won't ever work or ever have worked, and you would have noticed

PS- 0.9.8a is pretty old. That may or may not matter to your problem.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to