ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/ssldest.htm

302 lines
8.2 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>SSL_Destroy()--End SSL Support for the Specified SSL Session</title>
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Begin Header Records ========================================== -->
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>SSL_Destroy()--End SSL Support for the Specified SSL Session</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;qsossl.h&gt;
int SSL_Destroy(SSLHandle* <em>handle</em>)
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QSOSSLSR<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong><em>SSL_Destroy()</em></strong> function is used by a program to
end SSL support for the specified SSL session. The SSL session to be ended is
identified by the <em>handle</em> parameter.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt>SSLHandle* <strong><em>handle</em></strong> &nbsp;(input)&nbsp;</dt>
<dd>The pointer to an <strong><em>SSLHandle</em></strong> for an active SSL
session, which is being ended. An <strong><em>SSLHandle</em></strong> is a
typedef for a buffer of type struct <strong><em>SSLHandleStr</em></strong>. In
<strong>&lt;qsossl.h&gt;</strong>, struct <strong><em>SSLHandleStr</em></strong>
is defined as the following:<br>
<pre>
struct SSLHandleStr { /* SSLHandleStr */
int fd; /* Socket descriptor */
int createFlags; /* SSL_Create flags value */
unsigned protocol; /* SSL protocol version */
unsigned timeout; /* Timeout value in seconds */
unsigned char cipherKind[3]; /* Current 2.0 cipher suite*/
unsigned short int cipherSuite; /* Current 3.0 cipher suite */
unsigned short int* cipherSuiteList; /* List of cipher suites */
unsigned int cipherSuiteListLen; /* Number of entries in
the cipher suites list */
unsigned char* peerCert; /* Peer certificate */
unsigned peerCertLen; /* Peer certificate length */
int peerCertValidateRc; /* Return code from
validation of certficate */
int (*exitPgm)(struct SSLHandleStr* sslh);
/* Authentication exit
program called when a
certificate is received
during SSL handshake */
};
</pre>
<br>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3>Return Value</h3>
<p>The <em>SSL_Destroy()</em> API returns an integer. Possible values are:</p>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td align="left" valign="top"><em>[0]</em> </td>
<td align="left" valign="top">Successful return</td>
</tr>
<tr>
<td align="left" valign="top"><em>[SSL_ERROR_IO]</em> </td>
<td align="left" valign="top">An error occurred in SSL processing; check the
<em>errno</em> value.</td>
</tr>
</table>
<br>
<h3>Error Conditions</h3>
<p>When the <em>SSL_Destroy()</em> API fails with return code [SSL_ERROR_IO],
<em>errno</em> can be set to:</p>
<dl>
<dt><em>[EBADF]</em> </dt>
<dd>
<p>Descriptor not valid.</p>
</dd>
<dt><em>[EFAULT]</em> </dt>
<dd>
<p>Bad address.</p>
<p>The system detected an address that was not valid while attempting to access
the <em>handle</em> parameter or a field within the structure pointed to by the
<em>handle</em> parameter.</p>
</dd>
<dt><em>[EIO]</em> </dt>
<dd>
<p>Input/output error.</p>
</dd>
<dt><em>[EINVAL]</em> </dt>
<dd>
<p>Parameter not valid. This error code indicates one of the following:</p>
<ul>
<li>The <em>socket_descriptor</em> type is not SOCK_STREAM or address family is
not AF_INET or AF_INET6.</li>
<li>One of the parameters passed is not valid or is NULL.</li>
</ul>
<br>
</dd>
<dt><em>[ENOTCONN]</em> </dt>
<dd>
<p>Requested operation requires a connection.</p>
<p>This error code indicates that the <em>socket_descriptor</em> has not had
SSL support enabled. This usually means that an <em>SSL_Create()</em> has not
been completed for this <em>socket_descriptor</em>.</p>
</dd>
<dt><em>[ENOTSOCK]</em> </dt>
<dd>
<p>The specified descriptor does not reference a socket.</p>
</dd>
<dt><em>[EPIPE]</em> </dt>
<dd>
<p>Broken pipe.</p>
</dd>
<dt><em>[ETIMEDOUT]</em> </dt>
<dd>
<p>A remote host did not respond within the timeout period.</p>
<p>This error code indicates that the <em>SSL_Destroy()</em> was unable to
successfully complete the removal of SSL support on this
<em>socket_descriptor</em>.</p>
</dd>
<dt><em>[EUNATCH]</em> </dt>
<dd>
<p>The protocol required to support the specified address family is not
available at this time.</p>
</dd>
<dt><em>[EUNKNOWN]</em> </dt>
<dd>
<p>Unknown system state.</p>
</dd>
</dl>
<br>
<br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="5">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td align="left" valign="top">CPE3418 E</td>
<td align="left" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9872 E</td>
<td align="left" valign="top">Program or service program &amp;1 in library
&amp;2 ended. Reason code &amp;3.</td>
</tr>
<tr>
<td align="left" valign="top">CPFA081 E</td>
<td align="left" valign="top">Unable to set return value or error code.</td>
</tr>
</table>
<br>
<br>
<h3>Usage Notes</h3>
<ol>
<li>All storage referenced from any field within the structure pointed to by
the <em>handle</em> parameter and the storage pointed to by the <em>handle</em>
parameter itself will be freed upon a successful return.<br>
<br>
</li>
<li>Unpredictable results will occur if you attempt to use an
<em>SSL_Destroy()</em> while sending or receiving data on the peer system.<br>
<br>
</li>
<li>If an <em>SSL_Destroy()</em> is not done, then the storage referenced by
the <em>handle</em> parameter will not be freed until the job ends.
<p><strong>Note:</strong> A job end might cause a Licensed Internal Code log
entry or error log entry if the <em>handle</em> parameter storage is not freed
before the job ended.</p>
</li>
<li>If an <em>SSL_Destroy()</em> is not done, the storage referenced by the
<em>handle</em> parameter will not be freed. This will result in a memory leak.
A <strong>memory leak</strong> is the loss of a piece of system memory because
it is not allocated to any process on the system.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="sslcreat.htm">SSL_Create()</a>--Enable SSL Support for the Specified
Socket Descriptor<br>
<br>
</li>
<li><a href="sslhands.htm">SSL_Handshake()</a>--Initiate the SSL Handshake
Protocol<br>
<br>
</li>
<li><a href="sslinit.htm">SSL_Init()</a>--Initialize the Current Job for
SSL<br>
<br>
</li>
<li><a href="sslread.htm">SSL_Read()</a>--Receive Data from an SSL-Enabled Socket
Descriptor<br>
<br>
</li>
<li><a href="sslwrite.htm">SSL_Write()</a>--Write Data to an SSL-Enabled Socket
Descriptor</li>
</ul>
<br>
<hr>
API introduced: V4R3
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a> </td>
</tr>
</table></center>
</body>
</html>