| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>GDtlsConnection: GIO Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| <link rel="home" href="index.html" title="GIO Reference Manual"> |
| <link rel="up" href="tls.html" title="TLS (SSL) support"> |
| <link rel="prev" href="GTlsServerConnection.html" title="GTlsServerConnection"> |
| <link rel="next" href="GDtlsClientConnection.html" title="GDtlsClientConnection"> |
| <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> |
| <link rel="stylesheet" href="style.css" type="text/css"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> |
| <td width="100%" align="left" class="shortcuts"> |
| <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_derived_interfaces"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.derived-interfaces" class="shortcut">Known Derived Interfaces</a></span><span id="nav_properties"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.properties" class="shortcut">Properties</a></span><span id="nav_signals"> <span class="dim">|</span> |
| <a href="#GDtlsConnection.signals" class="shortcut">Signals</a></span> |
| </td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| <td><a accesskey="u" href="tls.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <td><a accesskey="p" href="GTlsServerConnection.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| <td><a accesskey="n" href="GDtlsClientConnection.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| </tr></table> |
| <div class="refentry"> |
| <a name="GDtlsConnection"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="GDtlsConnection.top_of_page"></a>GDtlsConnection</span></h2> |
| <p>GDtlsConnection — DTLS connection type</p> |
| </td> |
| <td class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.functions"></a><h2>Functions</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="functions_return"> |
| <col class="functions_name"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-certificate" title="g_dtls_connection_set_certificate ()">g_dtls_connection_set_certificate</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-certificate" title="g_dtls_connection_get_certificate ()">g_dtls_connection_get_certificate</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-peer-certificate" title="g_dtls_connection_get_peer_certificate ()">g_dtls_connection_get_peer_certificate</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-peer-certificate-errors" title="g_dtls_connection_get_peer_certificate_errors ()">g_dtls_connection_get_peer_certificate_errors</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-require-close-notify" title="g_dtls_connection_set_require_close_notify ()">g_dtls_connection_set_require_close_notify</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-require-close-notify" title="g_dtls_connection_get_require_close_notify ()">g_dtls_connection_get_require_close_notify</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-rehandshake-mode" title="g_dtls_connection_set_rehandshake_mode ()">g_dtls_connection_set_rehandshake_mode</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTlsConnection.html#GTlsRehandshakeMode" title="enum GTlsRehandshakeMode"><span class="returnvalue">GTlsRehandshakeMode</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-rehandshake-mode" title="g_dtls_connection_get_rehandshake_mode ()">g_dtls_connection_get_rehandshake_mode</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="returnvalue">GTlsDatabase</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-database" title="g_dtls_connection_get_database ()">g_dtls_connection_get_database</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-database" title="g_dtls_connection_set_database ()">g_dtls_connection_set_database</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="returnvalue">GTlsInteraction</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-get-interaction" title="g_dtls_connection_get_interaction ()">g_dtls_connection_get_interaction</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-interaction" title="g_dtls_connection_set_interaction ()">g_dtls_connection_set_interaction</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake" title="g_dtls_connection_handshake ()">g_dtls_connection_handshake</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake-async" title="g_dtls_connection_handshake_async ()">g_dtls_connection_handshake_async</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake-finish" title="g_dtls_connection_handshake_finish ()">g_dtls_connection_handshake_finish</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown" title="g_dtls_connection_shutdown ()">g_dtls_connection_shutdown</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown-async" title="g_dtls_connection_shutdown_async ()">g_dtls_connection_shutdown_async</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown-finish" title="g_dtls_connection_shutdown_finish ()">g_dtls_connection_shutdown_finish</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()">g_dtls_connection_close</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-close-async" title="g_dtls_connection_close_async ()">g_dtls_connection_close_async</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-close-finish" title="g_dtls_connection_close_finish ()">g_dtls_connection_close_finish</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-emit-accept-certificate" title="g_dtls_connection_emit_accept_certificate ()">g_dtls_connection_emit_accept_certificate</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.properties"></a><h2>Properties</h2> |
| <div class="informaltable"><table class="informaltable" border="0"> |
| <colgroup> |
| <col width="150px" class="properties_type"> |
| <col width="300px" class="properties_name"> |
| <col width="200px" class="properties_flags"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="property_type"> |
| <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> *</td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--base-socket" title="The “base-socket” property">base-socket</a></td> |
| <td class="property_flags">Read / Write / Construct Only</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *</td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--certificate" title="The “certificate” property">certificate</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="type">GTlsDatabase</span></a> *</td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--database" title="The “database” property">database</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *</td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--interaction" title="The “interaction” property">interaction</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *</td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--peer-certificate" title="The “peer-certificate” property">peer-certificate</a></td> |
| <td class="property_flags">Read</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--peer-certificate-errors" title="The “peer-certificate-errors” property">peer-certificate-errors</a></td> |
| <td class="property_flags">Read</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a class="link" href="GTlsConnection.html#GTlsRehandshakeMode" title="enum GTlsRehandshakeMode"><span class="type">GTlsRehandshakeMode</span></a></td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--rehandshake-mode" title="The “rehandshake-mode” property">rehandshake-mode</a></td> |
| <td class="property_flags">Read / Write / Construct</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> |
| <td class="property_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection--require-close-notify" title="The “require-close-notify” property">require-close-notify</a></td> |
| <td class="property_flags">Read / Write / Construct</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.signals"></a><h2>Signals</h2> |
| <div class="informaltable"><table class="informaltable" border="0"> |
| <colgroup> |
| <col width="150px" class="signals_return"> |
| <col width="300px" class="signals_name"> |
| <col width="200px" class="signals_flags"> |
| </colgroup> |
| <tbody><tr> |
| <td class="signal_type"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a></td> |
| <td class="signal_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal">accept-certificate</a></td> |
| <td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody><tr> |
| <td class="datatype_keyword"> </td> |
| <td class="function_name"><a class="link" href="GDtlsConnection.html#GDtlsConnection-struct" title="GDtlsConnection">GDtlsConnection</a></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| <pre class="screen"> <a href="https://developer.gnome.org/gobject/unstable/GTypeModule.html">GInterface</a> |
| <span class="lineart">╰──</span> GDtlsConnection |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.prerequisites"></a><h2>Prerequisites</h2> |
| <p> |
| GDtlsConnection requires |
| <a class="link" href="GDatagramBased.html" title="GDatagramBased">GDatagramBased</a> and <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>.</p> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.derived-interfaces"></a><h2>Known Derived Interfaces</h2> |
| <p> |
| GDtlsConnection is required by |
| <a class="link" href="GDtlsClientConnection.html" title="GDtlsClientConnection">GDtlsClientConnection</a> and <a class="link" href="GDtlsServerConnection.html" title="GDtlsServerConnection">GDtlsServerConnection</a>.</p> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.includes"></a><h2>Includes</h2> |
| <pre class="synopsis">#include <gio/gio.h> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.description"></a><h2>Description</h2> |
| <p><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> is the base DTLS connection class type, which wraps |
| a <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> and provides DTLS encryption on top of it. Its |
| subclasses, <a class="link" href="GDtlsClientConnection.html" title="GDtlsClientConnection"><span class="type">GDtlsClientConnection</span></a> and <a class="link" href="GDtlsServerConnection.html" title="GDtlsServerConnection"><span class="type">GDtlsServerConnection</span></a>, |
| implement client-side and server-side DTLS, respectively.</p> |
| <p>For TLS support, see <a class="link" href="GTlsConnection.html" title="GTlsConnection"><span class="type">GTlsConnection</span></a>.</p> |
| <p>As DTLS is datagram based, <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> implements <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a>, |
| presenting a datagram-socket-like API for the encrypted connection. This |
| operates over a base datagram connection, which is also a <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> |
| (<a class="link" href="GDtlsConnection.html#GDtlsConnection--base-socket" title="The “base-socket” property"><span class="type">“base-socket”</span></a>).</p> |
| <p>To close a DTLS connection, use <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()"><code class="function">g_dtls_connection_close()</code></a>.</p> |
| <p>Neither <a class="link" href="GDtlsServerConnection.html" title="GDtlsServerConnection"><span class="type">GDtlsServerConnection</span></a> or <a class="link" href="GDtlsClientConnection.html" title="GDtlsClientConnection"><span class="type">GDtlsClientConnection</span></a> set the peer address |
| on their base <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> if it is a <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> — it is up to the caller to |
| do that if they wish. If they do not, and <a class="link" href="GSocket.html#g-socket-close" title="g_socket_close ()"><code class="function">g_socket_close()</code></a> is called on the |
| base socket, the <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> will not raise a <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-CONNECTED:CAPS"><code class="literal">G_IO_ERROR_NOT_CONNECTED</code></a> |
| error on further I/O.</p> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.functions_details"></a><h2>Functions</h2> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-set-certificate"></a><h3>g_dtls_connection_set_certificate ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_set_certificate (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *certificate</code></em>);</pre> |
| <p>This sets the certificate that <em class="parameter"><code>conn</code></em> |
| will present to its peer |
| during the TLS handshake. For a <a class="link" href="GDtlsServerConnection.html" title="GDtlsServerConnection"><span class="type">GDtlsServerConnection</span></a>, it is |
| mandatory to set this, and that will normally be done at construct |
| time.</p> |
| <p>For a <a class="link" href="GDtlsClientConnection.html" title="GDtlsClientConnection"><span class="type">GDtlsClientConnection</span></a>, this is optional. If a handshake fails |
| with <a class="link" href="gio-TLS-Overview.html#G-TLS-ERROR-CERTIFICATE-REQUIRED:CAPS"><code class="literal">G_TLS_ERROR_CERTIFICATE_REQUIRED</code></a>, that means that the server |
| requires a certificate, and if you try connecting again, you should |
| call this method first. You can call |
| <a class="link" href="GDtlsClientConnection.html#g-dtls-client-connection-get-accepted-cas" title="g_dtls_client_connection_get_accepted_cas ()"><code class="function">g_dtls_client_connection_get_accepted_cas()</code></a> on the failed connection |
| to get a list of Certificate Authorities that the server will |
| accept certificates from.</p> |
| <p>(It is also possible that a server will allow the connection with |
| or without a certificate; in that case, if you don't provide a |
| certificate, you can tell that the server requested one by the fact |
| that <a class="link" href="GDtlsClientConnection.html#g-dtls-client-connection-get-accepted-cas" title="g_dtls_client_connection_get_accepted_cas ()"><code class="function">g_dtls_client_connection_get_accepted_cas()</code></a> will return |
| non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.)</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-set-certificate.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>certificate</p></td> |
| <td class="parameter_description"><p>the certificate to use for <em class="parameter"><code>conn</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-certificate"></a><h3>g_dtls_connection_get_certificate ()</h3> |
| <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> * |
| g_dtls_connection_get_certificate (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Gets <em class="parameter"><code>conn</code></em> |
| 's certificate, as set by |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-certificate" title="g_dtls_connection_set_certificate ()"><code class="function">g_dtls_connection_set_certificate()</code></a>.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-certificate.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-certificate.returns"></a><h4>Returns</h4> |
| <p> <em class="parameter"><code>conn</code></em> |
| 's certificate, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-peer-certificate"></a><h3>g_dtls_connection_get_peer_certificate ()</h3> |
| <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> * |
| g_dtls_connection_get_peer_certificate |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Gets <em class="parameter"><code>conn</code></em> |
| 's peer's certificate after the handshake has completed. |
| (It is not set during the emission of |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a>.)</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-peer-certificate.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-peer-certificate.returns"></a><h4>Returns</h4> |
| <p> <em class="parameter"><code>conn</code></em> |
| 's peer's certificate, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-peer-certificate-errors"></a><h3>g_dtls_connection_get_peer_certificate_errors ()</h3> |
| <pre class="programlisting"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a> |
| g_dtls_connection_get_peer_certificate_errors |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Gets the errors associated with validating <em class="parameter"><code>conn</code></em> |
| 's peer's |
| certificate, after the handshake has completed. (It is not set |
| during the emission of <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a>.)</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-peer-certificate-errors.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-peer-certificate-errors.returns"></a><h4>Returns</h4> |
| <p> <em class="parameter"><code>conn</code></em> |
| 's peer's certificate errors</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-set-require-close-notify"></a><h3>g_dtls_connection_set_require_close_notify ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_set_require_close_notify |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> require_close_notify</code></em>);</pre> |
| <p>Sets whether or not <em class="parameter"><code>conn</code></em> |
| expects a proper TLS close notification |
| before the connection is closed. If this is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the default), |
| then <em class="parameter"><code>conn</code></em> |
| will expect to receive a TLS close notification from its |
| peer before the connection is closed, and will return a |
| <a class="link" href="gio-TLS-Overview.html#G-TLS-ERROR-EOF:CAPS"><code class="literal">G_TLS_ERROR_EOF</code></a> error if the connection is closed without proper |
| notification (since this may indicate a network error, or |
| man-in-the-middle attack).</p> |
| <p>In some protocols, the application will know whether or not the |
| connection was closed cleanly based on application-level data |
| (because the application-level data includes a length field, or is |
| somehow self-delimiting); in this case, the close notify is |
| redundant and may be omitted. You |
| can use <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-require-close-notify" title="g_dtls_connection_set_require_close_notify ()"><code class="function">g_dtls_connection_set_require_close_notify()</code></a> to tell <em class="parameter"><code>conn</code></em> |
| |
| to allow an "unannounced" connection close, in which case the close |
| will show up as a 0-length read, as in a non-TLS |
| <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a>, and it is up to the application to check that |
| the data has been fully received.</p> |
| <p>Note that this only affects the behavior when the peer closes the |
| connection; when the application calls <a class="link" href="GDtlsConnection.html#g-dtls-connection-close-async" title="g_dtls_connection_close_async ()"><code class="function">g_dtls_connection_close_async()</code></a> on |
| <em class="parameter"><code>conn</code></em> |
| itself, this will send a close notification regardless of the |
| setting of this property. If you explicitly want to do an unclean |
| close, you can close <em class="parameter"><code>conn</code></em> |
| 's <a class="link" href="GDtlsConnection.html#GDtlsConnection--base-socket" title="The “base-socket” property"><span class="type">“base-socket”</span></a> rather |
| than closing <em class="parameter"><code>conn</code></em> |
| itself.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-set-require-close-notify.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>require_close_notify</p></td> |
| <td class="parameter_description"><p>whether or not to require close notification</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-require-close-notify"></a><h3>g_dtls_connection_get_require_close_notify ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_get_require_close_notify |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Tests whether or not <em class="parameter"><code>conn</code></em> |
| expects a proper TLS close notification |
| when the connection is closed. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-require-close-notify" title="g_dtls_connection_set_require_close_notify ()"><code class="function">g_dtls_connection_set_require_close_notify()</code></a> for details.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-require-close-notify.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-require-close-notify.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>conn</code></em> |
| requires a proper TLS close notification.</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-set-rehandshake-mode"></a><h3>g_dtls_connection_set_rehandshake_mode ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_set_rehandshake_mode |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GTlsConnection.html#GTlsRehandshakeMode" title="enum GTlsRehandshakeMode"><span class="type">GTlsRehandshakeMode</span></a> mode</code></em>);</pre> |
| <p>Sets how <em class="parameter"><code>conn</code></em> |
| behaves with respect to rehandshaking requests.</p> |
| <p><a class="link" href="GTlsConnection.html#G-TLS-REHANDSHAKE-NEVER:CAPS"><code class="literal">G_TLS_REHANDSHAKE_NEVER</code></a> means that it will never agree to |
| rehandshake after the initial handshake is complete. (For a client, |
| this means it will refuse rehandshake requests from the server, and |
| for a server, this means it will close the connection with an error |
| if the client attempts to rehandshake.)</p> |
| <p><a class="link" href="GTlsConnection.html#G-TLS-REHANDSHAKE-SAFELY:CAPS"><code class="literal">G_TLS_REHANDSHAKE_SAFELY</code></a> means that the connection will allow a |
| rehandshake only if the other end of the connection supports the |
| TLS <code class="literal">renegotiation_info</code> extension. This is the default behavior, |
| but means that rehandshaking will not work against older |
| implementations that do not support that extension.</p> |
| <p><a class="link" href="GTlsConnection.html#G-TLS-REHANDSHAKE-UNSAFELY:CAPS"><code class="literal">G_TLS_REHANDSHAKE_UNSAFELY</code></a> means that the connection will allow |
| rehandshaking even without the <code class="literal">renegotiation_info</code> extension. On |
| the server side in particular, this is not recommended, since it |
| leaves the server open to certain attacks. However, this mode is |
| necessary if you need to allow renegotiation with older client |
| software.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-set-rehandshake-mode.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>mode</p></td> |
| <td class="parameter_description"><p>the rehandshaking mode</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-rehandshake-mode"></a><h3>g_dtls_connection_get_rehandshake_mode ()</h3> |
| <pre class="programlisting"><a class="link" href="GTlsConnection.html#GTlsRehandshakeMode" title="enum GTlsRehandshakeMode"><span class="returnvalue">GTlsRehandshakeMode</span></a> |
| g_dtls_connection_get_rehandshake_mode |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Gets <em class="parameter"><code>conn</code></em> |
| rehandshaking mode. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-rehandshake-mode" title="g_dtls_connection_set_rehandshake_mode ()"><code class="function">g_dtls_connection_set_rehandshake_mode()</code></a> for details.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-rehandshake-mode.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-rehandshake-mode.returns"></a><h4>Returns</h4> |
| <p> <em class="parameter"><code>conn</code></em> |
| 's rehandshaking mode</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-database"></a><h3>g_dtls_connection_get_database ()</h3> |
| <pre class="programlisting"><a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="returnvalue">GTlsDatabase</span></a> * |
| g_dtls_connection_get_database (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Gets the certificate database that <em class="parameter"><code>conn</code></em> |
| uses to verify |
| peer certificates. See <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-database" title="g_dtls_connection_set_database ()"><code class="function">g_dtls_connection_set_database()</code></a>.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-database.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-database.returns"></a><h4>Returns</h4> |
| <p> the certificate database that <em class="parameter"><code>conn</code></em> |
| uses or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-set-database"></a><h3>g_dtls_connection_set_database ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_set_database (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="type">GTlsDatabase</span></a> *database</code></em>);</pre> |
| <p>Sets the certificate database that is used to verify peer certificates. |
| This is set to the default database by default. See |
| <code class="function">g_dtls_backend_get_default_database()</code>. If set to <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then |
| peer certificate validation will always set the |
| <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-UNKNOWN-CA:CAPS"><code class="literal">G_TLS_CERTIFICATE_UNKNOWN_CA</code></a> error (meaning |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a> will always be emitted on |
| client-side connections, unless that bit is not set in |
| <a class="link" href="GDtlsClientConnection.html#GDtlsClientConnection--validation-flags" title="The “validation-flags” property"><span class="type">“validation-flags”</span></a>).</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-set-database.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>database</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="type">GTlsDatabase</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-get-interaction"></a><h3>g_dtls_connection_get_interaction ()</h3> |
| <pre class="programlisting"><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="returnvalue">GTlsInteraction</span></a> * |
| g_dtls_connection_get_interaction (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>);</pre> |
| <p>Get the object that will be used to interact with the user. It will be used |
| for things like prompting the user for passwords. If <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then |
| no user interaction will occur for this connection.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-interaction.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a connection</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-get-interaction.returns"></a><h4>Returns</h4> |
| <p> The interaction object. </p> |
| <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-set-interaction"></a><h3>g_dtls_connection_set_interaction ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_set_interaction (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *interaction</code></em>);</pre> |
| <p>Set the object that will be used to interact with the user. It will be used |
| for things like prompting the user for passwords.</p> |
| <p>The <em class="parameter"><code>interaction</code></em> |
| argument will normally be a derived subclass of |
| <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a>. <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> can also be provided if no user interaction |
| should occur for this connection.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-set-interaction.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a connection</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>interaction</p></td> |
| <td class="parameter_description"><p> an interaction object, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-handshake"></a><h3>g_dtls_connection_handshake ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_handshake (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Attempts a TLS handshake on <em class="parameter"><code>conn</code></em> |
| .</p> |
| <p>On the client side, it is never necessary to call this method; |
| although the connection needs to perform a handshake after |
| connecting (or after sending a "STARTTLS"-type command) and may |
| need to rehandshake later if the server requests it, |
| <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> will handle this for you automatically when you try |
| to send or receive data on the connection. However, you can call |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake" title="g_dtls_connection_handshake ()"><code class="function">g_dtls_connection_handshake()</code></a> manually if you want to know for sure |
| whether the initial handshake succeeded or failed (as opposed to |
| just immediately trying to write to <em class="parameter"><code>conn</code></em> |
| , in which |
| case if it fails, it may not be possible to tell if it failed |
| before or after completing the handshake).</p> |
| <p>Likewise, on the server side, although a handshake is necessary at |
| the beginning of the communication, you do not need to call this |
| function explicitly unless you want clearer error reporting. |
| However, you may call <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake" title="g_dtls_connection_handshake ()"><code class="function">g_dtls_connection_handshake()</code></a> later on to |
| renegotiate parameters (encryption methods, etc) with the client.</p> |
| <p><a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept_certificate”</span></a> may be emitted during the |
| handshake.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-handshake.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-handshake.returns"></a><h4>Returns</h4> |
| <p> success or failure</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-handshake-async"></a><h3>g_dtls_connection_handshake_async ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_handshake_async (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>Asynchronously performs a TLS handshake on <em class="parameter"><code>conn</code></em> |
| . See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake" title="g_dtls_connection_handshake ()"><code class="function">g_dtls_connection_handshake()</code></a> for more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-handshake-async.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>io_priority</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>callback</p></td> |
| <td class="parameter_description"><p>callback to call when the handshake is complete</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>the data to pass to the callback function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-handshake-finish"></a><h3>g_dtls_connection_handshake_finish ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_handshake_finish (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Finish an asynchronous TLS handshake operation. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-handshake" title="g_dtls_connection_handshake ()"><code class="function">g_dtls_connection_handshake()</code></a> for more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-handshake-finish.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>result</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-handshake-finish.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure, in which |
| case <em class="parameter"><code>error</code></em> |
| will be set.</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-shutdown"></a><h3>g_dtls_connection_shutdown ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_shutdown (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_read</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_write</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Shut down part or all of a DTLS connection.</p> |
| <p>If <em class="parameter"><code>shutdown_read</code></em> |
| is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the receiving side of the connection is shut |
| down, and further reading is disallowed. Subsequent calls to |
| <a class="link" href="GDatagramBased.html#g-datagram-based-receive-messages" title="g_datagram_based_receive_messages ()"><code class="function">g_datagram_based_receive_messages()</code></a> will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.</p> |
| <p>If <em class="parameter"><code>shutdown_write</code></em> |
| is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the sending side of the connection is shut |
| down, and further writing is disallowed. Subsequent calls to |
| <a class="link" href="GDatagramBased.html#g-datagram-based-send-messages" title="g_datagram_based_send_messages ()"><code class="function">g_datagram_based_send_messages()</code></a> will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.</p> |
| <p>It is allowed for both <em class="parameter"><code>shutdown_read</code></em> |
| and <em class="parameter"><code>shutdown_write</code></em> |
| to be TRUE — this |
| is equivalent to calling <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()"><code class="function">g_dtls_connection_close()</code></a>.</p> |
| <p>If <em class="parameter"><code>cancellable</code></em> |
| is cancelled, the <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> may be left |
| partially-closed and any pending untransmitted data may be lost. Call |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown" title="g_dtls_connection_shutdown ()"><code class="function">g_dtls_connection_shutdown()</code></a> again to complete closing the <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a>.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-shutdown.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>shutdown_read</p></td> |
| <td class="parameter_description"><p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop reception of incoming datagrams</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>shutdown_write</p></td> |
| <td class="parameter_description"><p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop sending outgoing datagrams</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-shutdown.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-shutdown-async"></a><h3>g_dtls_connection_shutdown_async ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_shutdown_async (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_read</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_write</code></em>, |
| <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>Asynchronously shut down part or all of the DTLS connection. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown" title="g_dtls_connection_shutdown ()"><code class="function">g_dtls_connection_shutdown()</code></a> for more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-shutdown-async.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>shutdown_read</p></td> |
| <td class="parameter_description"><p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop reception of incoming datagrams</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>shutdown_write</p></td> |
| <td class="parameter_description"><p><a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop sending outgoing datagrams</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>io_priority</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>callback</p></td> |
| <td class="parameter_description"><p>callback to call when the shutdown operation is complete</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>the data to pass to the callback function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-shutdown-finish"></a><h3>g_dtls_connection_shutdown_finish ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_shutdown_finish (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Finish an asynchronous TLS shutdown operation. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown" title="g_dtls_connection_shutdown ()"><code class="function">g_dtls_connection_shutdown()</code></a> for more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-shutdown-finish.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>result</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-shutdown-finish.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure, in which |
| case <em class="parameter"><code>error</code></em> |
| will be set</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-close"></a><h3>g_dtls_connection_close ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_close (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Close the DTLS connection. This is equivalent to calling |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-shutdown" title="g_dtls_connection_shutdown ()"><code class="function">g_dtls_connection_shutdown()</code></a> to shut down both sides of the connection.</p> |
| <p>Closing a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> waits for all buffered but untransmitted data to |
| be sent before it completes. It then sends a <code class="literal">close_notify</code> DTLS alert to the |
| peer and may wait for a <code class="literal">close_notify</code> to be received from the peer. It does |
| not close the underlying <a class="link" href="GDtlsConnection.html#GDtlsConnection--base-socket" title="The “base-socket” property"><span class="type">“base-socket”</span></a>; that must be closed |
| separately.</p> |
| <p>Once <em class="parameter"><code>conn</code></em> |
| is closed, all other operations will return <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. |
| Closing a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> multiple times will not return an error.</p> |
| <p><a href="GDtlsConnection.html#GDtlsConnection-struct"><span class="type">GDtlsConnections</span></a> will be automatically closed when the last reference is |
| dropped, but you might want to call this function to make sure resources are |
| released as early as possible.</p> |
| <p>If <em class="parameter"><code>cancellable</code></em> |
| is cancelled, the <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> may be left |
| partially-closed and any pending untransmitted data may be lost. Call |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()"><code class="function">g_dtls_connection_close()</code></a> again to complete closing the <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a>.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-close.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-close.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-close-async"></a><h3>g_dtls_connection_close_async ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_dtls_connection_close_async (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, |
| <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>Asynchronously close the DTLS connection. See <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()"><code class="function">g_dtls_connection_close()</code></a> for |
| more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-close-async.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>io_priority</p></td> |
| <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>cancellable</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>callback</p></td> |
| <td class="parameter_description"><p>callback to call when the close operation is complete</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>the data to pass to the callback function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-close-finish"></a><h3>g_dtls_connection_close_finish ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_close_finish (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, |
| <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> |
| <p>Finish an asynchronous TLS close operation. See <a class="link" href="GDtlsConnection.html#g-dtls-connection-close" title="g_dtls_connection_close ()"><code class="function">g_dtls_connection_close()</code></a> |
| for more information.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-close-finish.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>result</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>error</p></td> |
| <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-close-finish.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure, in which |
| case <em class="parameter"><code>error</code></em> |
| will be set</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-dtls-connection-emit-accept-certificate"></a><h3>g_dtls_connection_emit_accept_certificate ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_dtls_connection_emit_accept_certificate |
| (<em class="parameter"><code><a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn</code></em>, |
| <em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *peer_cert</code></em>, |
| <em class="parameter"><code><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> errors</code></em>);</pre> |
| <p>Used by <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> implementations to emit the |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a> signal.</p> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-emit-accept-certificate.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>peer_cert</p></td> |
| <td class="parameter_description"><p>the peer's <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>errors</p></td> |
| <td class="parameter_description"><p>the problems with <em class="parameter"><code>peer_cert</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-dtls-connection-emit-accept-certificate.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if one of the signal handlers has returned |
| <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to accept <em class="parameter"><code>peer_cert</code></em> |
| </p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GDtlsConnection-struct"></a><h3>GDtlsConnection</h3> |
| <pre class="programlisting">typedef struct _GDtlsConnection GDtlsConnection;</pre> |
| <p>Abstract base class for the backend-specific <a class="link" href="GDtlsClientConnection.html" title="GDtlsClientConnection"><span class="type">GDtlsClientConnection</span></a> |
| and <a class="link" href="GDtlsServerConnection.html" title="GDtlsServerConnection"><span class="type">GDtlsServerConnection</span></a> types.</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.property-details"></a><h2>Property Details</h2> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--base-socket"></a><h3>The <code class="literal">“base-socket”</code> property</h3> |
| <pre class="programlisting"> “base-socket” <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> *</pre> |
| <p>The <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a> that the connection wraps. Note that this may be any |
| implementation of <a class="link" href="GDatagramBased.html" title="GDatagramBased"><span class="type">GDatagramBased</span></a>, not just a <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a>.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--certificate"></a><h3>The <code class="literal">“certificate”</code> property</h3> |
| <pre class="programlisting"> “certificate” <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *</pre> |
| <p>The connection's certificate; see |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-certificate" title="g_dtls_connection_set_certificate ()"><code class="function">g_dtls_connection_set_certificate()</code></a>.</p> |
| <p>Flags: Read / Write</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--database"></a><h3>The <code class="literal">“database”</code> property</h3> |
| <pre class="programlisting"> “database” <a class="link" href="GTlsDatabase.html" title="GTlsDatabase"><span class="type">GTlsDatabase</span></a> *</pre> |
| <p>The certificate database to use when verifying this TLS connection. |
| If no certificate database is set, then the default database will be |
| used. See <code class="function">g_dtls_backend_get_default_database()</code>.</p> |
| <p>Flags: Read / Write</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--interaction"></a><h3>The <code class="literal">“interaction”</code> property</h3> |
| <pre class="programlisting"> “interaction” <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> *</pre> |
| <p>A <a class="link" href="GTlsInteraction.html" title="GTlsInteraction"><span class="type">GTlsInteraction</span></a> object to be used when the connection or certificate |
| database need to interact with the user. This will be used to prompt the |
| user for passwords where necessary.</p> |
| <p>Flags: Read / Write</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--peer-certificate"></a><h3>The <code class="literal">“peer-certificate”</code> property</h3> |
| <pre class="programlisting"> “peer-certificate” <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *</pre> |
| <p>The connection's peer's certificate, after the TLS handshake has |
| completed and the certificate has been accepted. Note in |
| particular that this is not yet set during the emission of |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a>.</p> |
| <p>(You can watch for a <a href="../gobject-The-Base-Object-Type.html#GObject-notify"><span class="type">“notify”</span></a> signal on this property to |
| detect when a handshake has occurred.)</p> |
| <p>Flags: Read</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--peer-certificate-errors"></a><h3>The <code class="literal">“peer-certificate-errors”</code> property</h3> |
| <pre class="programlisting"> “peer-certificate-errors” <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></pre> |
| <p>The errors noticed-and-ignored while verifying |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection--peer-certificate" title="The “peer-certificate” property"><span class="type">“peer-certificate”</span></a>. Normally this should be 0, but |
| it may not be if <a class="link" href="GDtlsClientConnection.html#GDtlsClientConnection--validation-flags" title="The “validation-flags” property"><span class="type">“validation-flags”</span></a> is not |
| <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-VALIDATE-ALL:CAPS"><code class="literal">G_TLS_CERTIFICATE_VALIDATE_ALL</code></a>, or if |
| <a class="link" href="GDtlsConnection.html#GDtlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a> overrode the default |
| behavior.</p> |
| <p>Flags: Read</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--rehandshake-mode"></a><h3>The <code class="literal">“rehandshake-mode”</code> property</h3> |
| <pre class="programlisting"> “rehandshake-mode” <a class="link" href="GTlsConnection.html#GTlsRehandshakeMode" title="enum GTlsRehandshakeMode"><span class="type">GTlsRehandshakeMode</span></a></pre> |
| <p>The rehandshaking mode. See |
| <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-rehandshake-mode" title="g_dtls_connection_set_rehandshake_mode ()"><code class="function">g_dtls_connection_set_rehandshake_mode()</code></a>.</p> |
| <p>Flags: Read / Write / Construct</p> |
| <p>Default value: G_TLS_REHANDSHAKE_NEVER</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GDtlsConnection--require-close-notify"></a><h3>The <code class="literal">“require-close-notify”</code> property</h3> |
| <pre class="programlisting"> “require-close-notify” <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Whether or not proper TLS close notification is required. |
| See <a class="link" href="GDtlsConnection.html#g-dtls-connection-set-require-close-notify" title="g_dtls_connection_set_require_close_notify ()"><code class="function">g_dtls_connection_set_require_close_notify()</code></a>.</p> |
| <p>Flags: Read / Write / Construct</p> |
| <p>Default value: TRUE</p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GDtlsConnection.signal-details"></a><h2>Signal Details</h2> |
| <div class="refsect2"> |
| <a name="GDtlsConnection-accept-certificate"></a><h3>The <code class="literal">“accept-certificate”</code> signal</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| user_function (<a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a> *conn, |
| <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *peer_cert, |
| <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> errors, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> |
| <p>Emitted during the TLS handshake after the peer certificate has |
| been received. You can examine <em class="parameter"><code>peer_cert</code></em> |
| 's certification path by |
| calling <a class="link" href="GTlsCertificate.html#g-tls-certificate-get-issuer" title="g_tls_certificate_get_issuer ()"><code class="function">g_tls_certificate_get_issuer()</code></a> on it.</p> |
| <p>For a client-side connection, <em class="parameter"><code>peer_cert</code></em> |
| is the server's |
| certificate, and the signal will only be emitted if the |
| certificate was not acceptable according to <em class="parameter"><code>conn</code></em> |
| 's |
| <a class="link" href="GDtlsClientConnection.html#GDtlsClientConnection--validation-flags" title="The “validation-flags” property"><span class="type">“validation_flags”</span></a>. If you would like the |
| certificate to be accepted despite <em class="parameter"><code>errors</code></em> |
| , return <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> from the |
| signal handler. Otherwise, if no handler accepts the certificate, |
| the handshake will fail with <a class="link" href="gio-TLS-Overview.html#G-TLS-ERROR-BAD-CERTIFICATE:CAPS"><code class="literal">G_TLS_ERROR_BAD_CERTIFICATE</code></a>.</p> |
| <p>For a server-side connection, <em class="parameter"><code>peer_cert</code></em> |
| is the certificate |
| presented by the client, if this was requested via the server's |
| <a class="link" href="GDtlsServerConnection.html#GDtlsServerConnection--authentication-mode" title="The “authentication-mode” property"><span class="type">“authentication_mode”</span></a>. On the server side, |
| the signal is always emitted when the client presents a |
| certificate, and the certificate will only be accepted if a |
| handler returns <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p> |
| <p>Note that if this signal is emitted as part of asynchronous I/O |
| in the main thread, then you should not attempt to interact with |
| the user before returning from the signal handler. If you want to |
| let the user decide whether or not to accept the certificate, you |
| would have to return <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> from the signal handler on the first |
| attempt, and then after the connection attempt returns a |
| <a class="link" href="gio-TLS-Overview.html#G-TLS-ERROR-HANDSHAKE:CAPS"><code class="literal">G_TLS_ERROR_HANDSHAKE</code></a>, you can interact with the user, and if |
| the user decides to accept the certificate, remember that fact, |
| create a new connection, and return <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> from the signal handler |
| the next time.</p> |
| <p>If you are doing I/O in another thread, you do not |
| need to worry about this, and can simply block in the signal |
| handler until the UI thread returns an answer.</p> |
| <div class="refsect3"> |
| <a name="GDtlsConnection-accept-certificate.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>conn</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GDtlsConnection.html" title="GDtlsConnection"><span class="type">GDtlsConnection</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>peer_cert</p></td> |
| <td class="parameter_description"><p>the peer's <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>errors</p></td> |
| <td class="parameter_description"><p>the problems with <em class="parameter"><code>peer_cert</code></em> |
| .</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GDtlsConnection-accept-certificate.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to accept <em class="parameter"><code>peer_cert</code></em> |
| (which will also |
| immediately end the signal emission). <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to allow the signal |
| emission to continue, which will cause the handshake to fail if |
| no one else overrides it.</p> |
| </div> |
| <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p> |
| <p class="since">Since: <a class="link" href="api-index-2-48.html#api-index-2.48">2.48</a></p> |
| </div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.25.1</div> |
| </body> |
| </html> |