-<!-- $Id: comstack.xml,v 1.10 2003-02-21 12:06:05 adam Exp $ -->
<chapter id="comstack"><title>The COMSTACK Module</title>
<sect1 id="comstack.synopsis"><title>Synopsis (blocking mode)</title>
</sect1>
<sect1 id="comstack.common"><title>Common Functions</title>
- <sect2><title>Managing Endpoints</title>
+ <sect2 id="comstack.managing.endpoints"><title>Managing Endpoints</title>
<synopsis>
COMSTACK cs_create(CS_TYPE type, int blocking, int protocol);
</note>
</sect2>
- <sect2><title>Data Exchange</title>
+ <sect2 id="comstack.data.exchange"><title>Data Exchange</title>
<synopsis>
int cs_put(COMSTACK handle, char *buf, int len);
</para>
<synopsis>
- <host> [ ':' <portnum> ]
+ <host> [ ':' <portnum> ]
</synopsis>
<para>
</sect1>
+ <sect1 id="comstack.ssl"><title>SSL</title>
+ <para>
+ <synopsis>
+ void *cs_get_ssl(COMSTACK cs);
+ </synopsis>
+ Returns the SSL handle, <literal>SSL *</literal> for comstack. If comstack
+ is not of type SSL, NULL is returned.
+ </para>
+
+ <para>
+ <synopsis>
+ int cs_set_ssl_ctx(COMSTACK cs, void *ctx);
+ </synopsis>
+ Sets SSL context for comstack. The parameter is expected to be of type
+ <literal>SSL_CTX *</literal>. This function should be called just
+ after comstack has been created (before connect, bind, etc).
+ This function returns 1 for success; 0 for failure.
+ </para>
+
+ <para>
+ <synopsis>
+ int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname);
+ </synopsis>
+ Sets SSL certificate for comstack as a PEM file. This function
+ returns 1 for success; 0 for failure.
+ </para>
+
+
+ <para>
+ <synopsis>
+ int cs_get_ssl_peer_certificate_x509(COMSTACK cs, char **buf, int *len);
+ </synopsis>
+ This function returns the peer certificate. If successful,
+ <literal>*buf</literal> and <literal>*len</literal> holds
+ X509 buffer and length respectively. Buffer should be freed
+ with <literal>xfree</literal>. This function returns 1 for success;
+ 0 for failure.
+ </para>
+
+ </sect1>
+
<sect1 id="comstack.diagnostics"><title>Diagnostics</title>
<para>
</para>
<synopsis>
- extern const char *cs_errlist[];
+ extern const char *cs_errlist[];
</synopsis>
<para>