Thanks for giving me a clue! Got that working.
However, the error "information" isn't informative at all. The only error
on the stack is:
'error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure'
Well, I kind of assumed THAT! What I want to know is WHY it failed. Where
does it tell me what went wrong? Could they not agree on a cipher? Was a
certificate or key missing or something like that? Was something wrong with
authentication?
How do I know why the two sides didn't connect?
Thanks again for the help,
Bill Rebey
-----Original Message-----
From: Lutz Jaenicke [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 11, 2001 5:12 AM
To: Openssl-Users (E-mail)
Subject: Re: Can't get SSL error information
On Fri, Aug 10, 2001 at 04:00:12PM -0400, Bill Rebey wrote:
> I can't get any error information out of OpenSSL. For example, when I
run
> this code sequence, which has a SSL_write() call that fails:
>
> SSL_load_error_strings();
> ERR_load_ERR_strings();
> OpenSSL_add_ssl_algorithms ();
> ...
> ...
> // This fails...
> iRetVal = SSL_write (_psslConnection, (char *)pvBuf, iSize);
> if (iRetVal == SOCKET_ERROR)
> {
> int iSSLErrno = SSL_get_error (_psslConnection, iRetVal);
> printf ("SSL Error is: '%s'\n",
> ERR_error_string(iSSLErrno,NULL)); // <<<DOESN'T WORK!
> }
>
> I get only the following output:
>
> SSL Error is: 'error:00000001:lib(0):func(0):reason(1)'
>
> How can I get meaningful error information out of OpenSSL? What am I
doing
> wrong?
You misunderstood the use of SSL_get_error() and ERR_error_string().
SSL_get_error() will return the error state of the actual SSL object
(see man SSL_get_error()). If a hard error was found (like SSL_ERROR_SSL)
then you will find the detailed error information by calling
ERR_get_error().
The return value of ERR_get_error() is what you have to pass to
ERR_error_string().
Best regards,
Lutz
--
Lutz Jaenicke [EMAIL PROTECTED]
BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]
======================= Confidentiality Statement =======================
The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL
and exempt from disclosure under applicable law. If you have received
this message in error, you are prohibited from copying, distributing, or
using the information. Please contact the sender immediately by return
e-mail and delete the original message from your system.
===================== End Confidentiality Statement =====================
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]