gtpc1m6b | Transmission Control Protocol/Internet Protocol |
The SSL_shutdown function shuts down data flow for a Secure
Sockets Layer (SSL) session.
Format
#include <openssl/ssl.h>
int SSL_shutdown(SSL *ssl)
- ssl
- A pointer to a token returned on the SSL_new call.
Normal Return
- Return code 0 indicates that the application issued the
SSL_shutdown function first. Continue issuing the
SSL_shutdown function until you receive return code 1, which
indicates the remote application has also shut down.
- In SSL version 3 and TLS version 1, return code 1 indicates that both the
client and server applications have issued the SSL_shutdown
function.
- In SSL version 2, a return code of 1 is always returned.
Error Return
A return code equal to -1 indicates an error. Issue the
SSL_get_error function to obtain specific information about the
error.
Programming Considerations
- The SSL_shutdown function is the normal way to shut down an SSL
session. It is a good idea that you shut down an SSL session before the
socket is shut down and closed.
- An alert is sent to the remote partner to notify it that the connection is
ending normally. Normal shutdown is required if you want to resume the
SSL session across a different socket at a later time.
- Both the client and server applications must issue the
SSL_shutdown function to shut down the connection normally.
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