gtpc1m5u | Transmission Control Protocol/Internet Protocol |
The SSL_get_error function returns information about why the
previous Secure Sockets Layer (SSL) application programming interface (API)
call resulted in an error return code.
Format
#include <openssl/ssl.h>
int SSL_get_error(SSL *ssl,int ret)
- ssl
- A pointer to a token returned on the SSL_new call.
- ret
- The return code from the previous SSL API call.
Normal Return
Returns one of the following values:
- SSL_ERROR_NONE
- No error to report. This is set when the value of the
ret parameter is greater than 0.
- SSL_ERROR_SSL
- An error occurred in the SSL library.
- SSL_ERROR_WANT_READ
- Processing was not completed successfully because there was no data
available for reading, and the socket available for the SSL session is in
nonblocking mode. Try the function again at a later time.
- SSL_ERROR_WANT_WRITE
- Processing was not completed successfully because the socket associated
with the SSL session is blocked from sending data. Try the function
again at a later time.
- SSL_ERROR_SYSCALL
- An I/O error occurred. Issue the sock_errno function to
determine the cause of the error.
- SSL_ERROR_ZERO_RETURN
- The remote application shut down the SSL connection normally. Issue
the SSL_shutdown function to shut down data flow for an SSL
session.
- SSL_ERROR_WANT_CONNECT
- Processing was not completed successfully because the SSL session was in
the process of starting the session, but it has not completed yet. Try
the function again at a later time.
Error Return
None.
Programming Considerations
- If an SSL API call results in an error return code, issue the
SSL_get_error function for the following functions to obtain the
reason for the error:
- SSL_accept
- SSL_connect
- SSL_read
- SSL_shutdown
- SSL_write.
- Do not use errno or the sock_errno
function to determine the cause of an SSL API error. Instead, you must
use the SSL_get_error function. However, if you received the
SSL_ERROR_SYSCALL return code after issuing the SSL_get_error
function, it is appropriate to use the sock_errno function.
Examples
For sample SSL applications, go to http://www.ibm.com/tpf/pubs/tpfpubs.htm,
click SSL for the TPF 4.1 System: An Online User's
Guide, and click Examples from the left navigation
bar.
Related Information