Imported Upstream version 2.50.2
[platform/upstream/glib.git] / docs / reference / gio / html / GTlsClientConnection.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GTlsClientConnection: GIO Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="tls.html" title="TLS (SSL) support">
9 <link rel="prev" href="GTlsConnection.html" title="GTlsConnection">
10 <link rel="next" href="GTlsServerConnection.html" title="GTlsServerConnection">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#GTlsClientConnection.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
19                   <a href="#GTlsClientConnection.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites">  <span class="dim">|</span> 
20                   <a href="#GTlsClientConnection.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_properties">  <span class="dim">|</span> 
21                   <a href="#GTlsClientConnection.properties" class="shortcut">Properties</a></span>
22 </td>
23 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
24 <td><a accesskey="u" href="tls.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
25 <td><a accesskey="p" href="GTlsConnection.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
26 <td><a accesskey="n" href="GTlsServerConnection.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27 </tr></table>
28 <div class="refentry">
29 <a name="GTlsClientConnection"></a><div class="titlepage"></div>
30 <div class="refnamediv"><table width="100%"><tr>
31 <td valign="top">
32 <h2><span class="refentrytitle"><a name="GTlsClientConnection.top_of_page"></a>GTlsClientConnection</span></h2>
33 <p>GTlsClientConnection — TLS client-side connection</p>
34 </td>
35 <td class="gallery_image" valign="top" align="right"></td>
36 </tr></table></div>
37 <div class="refsect1">
38 <a name="GTlsClientConnection.functions"></a><h2>Functions</h2>
39 <div class="informaltable"><table class="informaltable" width="100%" border="0">
40 <colgroup>
41 <col width="150px" class="functions_return">
42 <col class="functions_name">
43 </colgroup>
44 <tbody>
45 <tr>
46 <td class="function_type">
47 <a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *
48 </td>
49 <td class="function_name">
50 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-new" title="g_tls_client_connection_new ()">g_tls_client_connection_new</a> <span class="c_punctuation">()</span>
51 </td>
52 </tr>
53 <tr>
54 <td class="function_type">
55 <span class="returnvalue">void</span>
56 </td>
57 <td class="function_name">
58 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-set-server-identity" title="g_tls_client_connection_set_server_identity ()">g_tls_client_connection_set_server_identity</a> <span class="c_punctuation">()</span>
59 </td>
60 </tr>
61 <tr>
62 <td class="function_type">
63 <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> *
64 </td>
65 <td class="function_name">
66 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-get-server-identity" title="g_tls_client_connection_get_server_identity ()">g_tls_client_connection_get_server_identity</a> <span class="c_punctuation">()</span>
67 </td>
68 </tr>
69 <tr>
70 <td class="function_type">
71 <span class="returnvalue">void</span>
72 </td>
73 <td class="function_name">
74 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-set-validation-flags" title="g_tls_client_connection_set_validation_flags ()">g_tls_client_connection_set_validation_flags</a> <span class="c_punctuation">()</span>
75 </td>
76 </tr>
77 <tr>
78 <td class="function_type">
79 <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a>
80 </td>
81 <td class="function_name">
82 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-get-validation-flags" title="g_tls_client_connection_get_validation_flags ()">g_tls_client_connection_get_validation_flags</a> <span class="c_punctuation">()</span>
83 </td>
84 </tr>
85 <tr>
86 <td class="function_type">
87 <span class="returnvalue">void</span>
88 </td>
89 <td class="function_name">
90 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-set-use-ssl3" title="g_tls_client_connection_set_use_ssl3 ()">g_tls_client_connection_set_use_ssl3</a> <span class="c_punctuation">()</span>
91 </td>
92 </tr>
93 <tr>
94 <td class="function_type">
95 <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
96 </td>
97 <td class="function_name">
98 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-get-use-ssl3" title="g_tls_client_connection_get_use_ssl3 ()">g_tls_client_connection_get_use_ssl3</a> <span class="c_punctuation">()</span>
99 </td>
100 </tr>
101 <tr>
102 <td class="function_type">
103 <a href="../glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
104 </td>
105 <td class="function_name">
106 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-get-accepted-cas" title="g_tls_client_connection_get_accepted_cas ()">g_tls_client_connection_get_accepted_cas</a> <span class="c_punctuation">()</span>
107 </td>
108 </tr>
109 <tr>
110 <td class="function_type">
111 <span class="returnvalue">void</span>
112 </td>
113 <td class="function_name">
114 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-copy-session-state" title="g_tls_client_connection_copy_session_state ()">g_tls_client_connection_copy_session_state</a> <span class="c_punctuation">()</span>
115 </td>
116 </tr>
117 </tbody>
118 </table></div>
119 </div>
120 <div class="refsect1">
121 <a name="GTlsClientConnection.properties"></a><h2>Properties</h2>
122 <div class="informaltable"><table class="informaltable" border="0">
123 <colgroup>
124 <col width="150px" class="properties_type">
125 <col width="300px" class="properties_name">
126 <col width="200px" class="properties_flags">
127 </colgroup>
128 <tbody>
129 <tr>
130 <td class="property_type"><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a></td>
131 <td class="property_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnection--accepted-cas" title="The “accepted-cas” property">accepted-cas</a></td>
132 <td class="property_flags">Read</td>
133 </tr>
134 <tr>
135 <td class="property_type">
136 <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *</td>
137 <td class="property_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnection--server-identity" title="The “server-identity” property">server-identity</a></td>
138 <td class="property_flags">Read / Write / Construct</td>
139 </tr>
140 <tr>
141 <td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
142 <td class="property_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnection--use-ssl3" title="The “use-ssl3” property">use-ssl3</a></td>
143 <td class="property_flags">Read / Write / Construct</td>
144 </tr>
145 <tr>
146 <td class="property_type"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></td>
147 <td class="property_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnection--validation-flags" title="The “validation-flags” property">validation-flags</a></td>
148 <td class="property_flags">Read / Write / Construct</td>
149 </tr>
150 </tbody>
151 </table></div>
152 </div>
153 <div class="refsect1">
154 <a name="GTlsClientConnection.other"></a><h2>Types and Values</h2>
155 <div class="informaltable"><table class="informaltable" width="100%" border="0">
156 <colgroup>
157 <col width="150px" class="name">
158 <col class="description">
159 </colgroup>
160 <tbody>
161 <tr>
162 <td class="datatype_keyword"> </td>
163 <td class="function_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnection-struct" title="GTlsClientConnection">GTlsClientConnection</a></td>
164 </tr>
165 <tr>
166 <td class="datatype_keyword">struct</td>
167 <td class="function_name"><a class="link" href="GTlsClientConnection.html#GTlsClientConnectionInterface" title="struct GTlsClientConnectionInterface">GTlsClientConnectionInterface</a></td>
168 </tr>
169 </tbody>
170 </table></div>
171 </div>
172 <div class="refsect1">
173 <a name="GTlsClientConnection.object-hierarchy"></a><h2>Object Hierarchy</h2>
174 <pre class="screen">    <a href="https://developer.gnome.org/gobject/unstable/GTypeModule.html">GInterface</a>
175     <span class="lineart">╰──</span> GTlsClientConnection
176 </pre>
177 </div>
178 <div class="refsect1">
179 <a name="GTlsClientConnection.prerequisites"></a><h2>Prerequisites</h2>
180 <p>
181 GTlsClientConnection requires
182  <a class="link" href="GTlsConnection.html" title="GTlsConnection">GTlsConnection</a>.</p>
183 </div>
184 <div class="refsect1">
185 <a name="GTlsClientConnection.includes"></a><h2>Includes</h2>
186 <pre class="synopsis">#include &lt;gio/gio.h&gt;
187 </pre>
188 </div>
189 <div class="refsect1">
190 <a name="GTlsClientConnection.description"></a><h2>Description</h2>
191 <p><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> is the client-side subclass of
192 <a class="link" href="GTlsConnection.html" title="GTlsConnection"><span class="type">GTlsConnection</span></a>, representing a client-side TLS connection.</p>
193 </div>
194 <div class="refsect1">
195 <a name="GTlsClientConnection.functions_details"></a><h2>Functions</h2>
196 <div class="refsect2">
197 <a name="g-tls-client-connection-new"></a><h3>g_tls_client_connection_new ()</h3>
198 <pre class="programlisting"><a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> *
199 g_tls_client_connection_new (<em class="parameter"><code><a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *base_io_stream</code></em>,
200                              <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *server_identity</code></em>,
201                              <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
202 <p>Creates a new <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> wrapping <em class="parameter"><code>base_io_stream</code></em>
203  (which
204 must have pollable input and output streams) which is assumed to
205 communicate with the server identified by <em class="parameter"><code>server_identity</code></em>
206 .</p>
207 <p>See the documentation for <a class="link" href="GTlsConnection.html#GTlsConnection--base-io-stream" title="The “base-io-stream” property"><span class="type">“base-io-stream”</span></a> for restrictions
208 on when application code can run operations on the <em class="parameter"><code>base_io_stream</code></em>
209  after
210 this function has returned.</p>
211 <div class="refsect3">
212 <a name="g-tls-client-connection-new.parameters"></a><h4>Parameters</h4>
213 <div class="informaltable"><table class="informaltable" width="100%" border="0">
214 <colgroup>
215 <col width="150px" class="parameters_name">
216 <col class="parameters_description">
217 <col width="200px" class="parameters_annotations">
218 </colgroup>
219 <tbody>
220 <tr>
221 <td class="parameter_name"><p>base_io_stream</p></td>
222 <td class="parameter_description"><p>the <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> to wrap</p></td>
223 <td class="parameter_annotations"> </td>
224 </tr>
225 <tr>
226 <td class="parameter_name"><p>server_identity</p></td>
227 <td class="parameter_description"><p> the expected identity of the server. </p></td>
228 <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>
229 </tr>
230 <tr>
231 <td class="parameter_name"><p>error</p></td>
232 <td class="parameter_description"><p><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
233 <td class="parameter_annotations"> </td>
234 </tr>
235 </tbody>
236 </table></div>
237 </div>
238 <div class="refsect3">
239 <a name="g-tls-client-connection-new.returns"></a><h4>Returns</h4>
240 <p> the new
241 <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
242 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GTlsClientConnection]</span></p>
243 </div>
244 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
245 </div>
246 <hr>
247 <div class="refsect2">
248 <a name="g-tls-client-connection-set-server-identity"></a><h3>g_tls_client_connection_set_server_identity ()</h3>
249 <pre class="programlisting"><span class="returnvalue">void</span>
250 g_tls_client_connection_set_server_identity
251                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>,
252                                 <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *identity</code></em>);</pre>
253 <p>Sets <em class="parameter"><code>conn</code></em>
254 's expected server identity, which is used both to tell
255 servers on virtual hosts which certificate to present, and also
256 to let <em class="parameter"><code>conn</code></em>
257  know what name to look for in the certificate when
258 performing <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-BAD-IDENTITY:CAPS"><code class="literal">G_TLS_CERTIFICATE_BAD_IDENTITY</code></a> validation, if enabled.</p>
259 <div class="refsect3">
260 <a name="g-tls-client-connection-set-server-identity.parameters"></a><h4>Parameters</h4>
261 <div class="informaltable"><table class="informaltable" width="100%" border="0">
262 <colgroup>
263 <col width="150px" class="parameters_name">
264 <col class="parameters_description">
265 <col width="200px" class="parameters_annotations">
266 </colgroup>
267 <tbody>
268 <tr>
269 <td class="parameter_name"><p>conn</p></td>
270 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
271 <td class="parameter_annotations"> </td>
272 </tr>
273 <tr>
274 <td class="parameter_name"><p>identity</p></td>
275 <td class="parameter_description"><p>a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> describing the expected server identity</p></td>
276 <td class="parameter_annotations"> </td>
277 </tr>
278 </tbody>
279 </table></div>
280 </div>
281 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
282 </div>
283 <hr>
284 <div class="refsect2">
285 <a name="g-tls-client-connection-get-server-identity"></a><h3>g_tls_client_connection_get_server_identity ()</h3>
286 <pre class="programlisting"><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> *
287 g_tls_client_connection_get_server_identity
288                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>);</pre>
289 <p>Gets <em class="parameter"><code>conn</code></em>
290 's expected server identity</p>
291 <div class="refsect3">
292 <a name="g-tls-client-connection-get-server-identity.parameters"></a><h4>Parameters</h4>
293 <div class="informaltable"><table class="informaltable" width="100%" border="0">
294 <colgroup>
295 <col width="150px" class="parameters_name">
296 <col class="parameters_description">
297 <col width="200px" class="parameters_annotations">
298 </colgroup>
299 <tbody><tr>
300 <td class="parameter_name"><p>conn</p></td>
301 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
302 <td class="parameter_annotations"> </td>
303 </tr></tbody>
304 </table></div>
305 </div>
306 <div class="refsect3">
307 <a name="g-tls-client-connection-get-server-identity.returns"></a><h4>Returns</h4>
308 <p> a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> describing the
309 expected server identity, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the expected identity is not
310 known. </p>
311 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
312 </div>
313 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
314 </div>
315 <hr>
316 <div class="refsect2">
317 <a name="g-tls-client-connection-set-validation-flags"></a><h3>g_tls_client_connection_set_validation_flags ()</h3>
318 <pre class="programlisting"><span class="returnvalue">void</span>
319 g_tls_client_connection_set_validation_flags
320                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>,
321                                 <em class="parameter"><code><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> flags</code></em>);</pre>
322 <p>Sets <em class="parameter"><code>conn</code></em>
323 's validation flags, to override the default set of
324 checks performed when validating a server certificate. By default,
325 <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-VALIDATE-ALL:CAPS"><code class="literal">G_TLS_CERTIFICATE_VALIDATE_ALL</code></a> is used.</p>
326 <div class="refsect3">
327 <a name="g-tls-client-connection-set-validation-flags.parameters"></a><h4>Parameters</h4>
328 <div class="informaltable"><table class="informaltable" width="100%" border="0">
329 <colgroup>
330 <col width="150px" class="parameters_name">
331 <col class="parameters_description">
332 <col width="200px" class="parameters_annotations">
333 </colgroup>
334 <tbody>
335 <tr>
336 <td class="parameter_name"><p>conn</p></td>
337 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
338 <td class="parameter_annotations"> </td>
339 </tr>
340 <tr>
341 <td class="parameter_name"><p>flags</p></td>
342 <td class="parameter_description"><p>the <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> to use</p></td>
343 <td class="parameter_annotations"> </td>
344 </tr>
345 </tbody>
346 </table></div>
347 </div>
348 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
349 </div>
350 <hr>
351 <div class="refsect2">
352 <a name="g-tls-client-connection-get-validation-flags"></a><h3>g_tls_client_connection_get_validation_flags ()</h3>
353 <pre class="programlisting"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a>
354 g_tls_client_connection_get_validation_flags
355                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>);</pre>
356 <p>Gets <em class="parameter"><code>conn</code></em>
357 's validation flags</p>
358 <div class="refsect3">
359 <a name="g-tls-client-connection-get-validation-flags.parameters"></a><h4>Parameters</h4>
360 <div class="informaltable"><table class="informaltable" width="100%" border="0">
361 <colgroup>
362 <col width="150px" class="parameters_name">
363 <col class="parameters_description">
364 <col width="200px" class="parameters_annotations">
365 </colgroup>
366 <tbody><tr>
367 <td class="parameter_name"><p>conn</p></td>
368 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
369 <td class="parameter_annotations"> </td>
370 </tr></tbody>
371 </table></div>
372 </div>
373 <div class="refsect3">
374 <a name="g-tls-client-connection-get-validation-flags.returns"></a><h4>Returns</h4>
375 <p> the validation flags</p>
376 </div>
377 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
378 </div>
379 <hr>
380 <div class="refsect2">
381 <a name="g-tls-client-connection-set-use-ssl3"></a><h3>g_tls_client_connection_set_use_ssl3 ()</h3>
382 <pre class="programlisting"><span class="returnvalue">void</span>
383 g_tls_client_connection_set_use_ssl3 (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>,
384                                       <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_ssl3</code></em>);</pre>
385 <p>If <em class="parameter"><code>use_ssl3</code></em>
386  is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, this forces <em class="parameter"><code>conn</code></em>
387  to use SSL 3.0 rather than
388 trying to properly negotiate the right version of TLS or SSL to use.
389 This can be used when talking to servers that do not implement the
390 fallbacks correctly and which will therefore fail to handshake with
391 a "modern" TLS handshake attempt.</p>
392 <div class="refsect3">
393 <a name="g-tls-client-connection-set-use-ssl3.parameters"></a><h4>Parameters</h4>
394 <div class="informaltable"><table class="informaltable" width="100%" border="0">
395 <colgroup>
396 <col width="150px" class="parameters_name">
397 <col class="parameters_description">
398 <col width="200px" class="parameters_annotations">
399 </colgroup>
400 <tbody>
401 <tr>
402 <td class="parameter_name"><p>conn</p></td>
403 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
404 <td class="parameter_annotations"> </td>
405 </tr>
406 <tr>
407 <td class="parameter_name"><p>use_ssl3</p></td>
408 <td class="parameter_description"><p>whether to use SSL 3.0</p></td>
409 <td class="parameter_annotations"> </td>
410 </tr>
411 </tbody>
412 </table></div>
413 </div>
414 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
415 </div>
416 <hr>
417 <div class="refsect2">
418 <a name="g-tls-client-connection-get-use-ssl3"></a><h3>g_tls_client_connection_get_use_ssl3 ()</h3>
419 <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
420 g_tls_client_connection_get_use_ssl3 (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>);</pre>
421 <p>Gets whether <em class="parameter"><code>conn</code></em>
422  will use SSL 3.0 rather than the
423 highest-supported version of TLS; see
424 <a class="link" href="GTlsClientConnection.html#g-tls-client-connection-set-use-ssl3" title="g_tls_client_connection_set_use_ssl3 ()"><code class="function">g_tls_client_connection_set_use_ssl3()</code></a>.</p>
425 <div class="refsect3">
426 <a name="g-tls-client-connection-get-use-ssl3.parameters"></a><h4>Parameters</h4>
427 <div class="informaltable"><table class="informaltable" width="100%" border="0">
428 <colgroup>
429 <col width="150px" class="parameters_name">
430 <col class="parameters_description">
431 <col width="200px" class="parameters_annotations">
432 </colgroup>
433 <tbody><tr>
434 <td class="parameter_name"><p>conn</p></td>
435 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
436 <td class="parameter_annotations"> </td>
437 </tr></tbody>
438 </table></div>
439 </div>
440 <div class="refsect3">
441 <a name="g-tls-client-connection-get-use-ssl3.returns"></a><h4>Returns</h4>
442 <p> whether <em class="parameter"><code>conn</code></em>
443 will use SSL 3.0</p>
444 </div>
445 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
446 </div>
447 <hr>
448 <div class="refsect2">
449 <a name="g-tls-client-connection-get-accepted-cas"></a><h3>g_tls_client_connection_get_accepted_cas ()</h3>
450 <pre class="programlisting"><a href="../glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
451 g_tls_client_connection_get_accepted_cas
452                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>);</pre>
453 <p>Gets the list of distinguished names of the Certificate Authorities
454 that the server will accept certificates from. This will be set
455 during the TLS handshake if the server requests a certificate.
456 Otherwise, it will be <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
457 <p>Each item in the list is a <a href="../glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> which contains the complete
458 subject DN of the certificate authority.</p>
459 <div class="refsect3">
460 <a name="g-tls-client-connection-get-accepted-cas.parameters"></a><h4>Parameters</h4>
461 <div class="informaltable"><table class="informaltable" width="100%" border="0">
462 <colgroup>
463 <col width="150px" class="parameters_name">
464 <col class="parameters_description">
465 <col width="200px" class="parameters_annotations">
466 </colgroup>
467 <tbody><tr>
468 <td class="parameter_name"><p>conn</p></td>
469 <td class="parameter_description"><p>the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
470 <td class="parameter_annotations"> </td>
471 </tr></tbody>
472 </table></div>
473 </div>
474 <div class="refsect3">
475 <a name="g-tls-client-connection-get-accepted-cas.returns"></a><h4>Returns</h4>
476 <p> the list of
477 CA DNs. You should unref each element with <a href="../glib-Byte-Arrays.html#g-byte-array-unref"><code class="function">g_byte_array_unref()</code></a> and then
478 the free the list with <a href="../glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a>. </p>
479 <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GByteArray][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
480 </div>
481 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
482 </div>
483 <hr>
484 <div class="refsect2">
485 <a name="g-tls-client-connection-copy-session-state"></a><h3>g_tls_client_connection_copy_session_state ()</h3>
486 <pre class="programlisting"><span class="returnvalue">void</span>
487 g_tls_client_connection_copy_session_state
488                                (<em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *conn</code></em>,
489                                 <em class="parameter"><code><a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> *source</code></em>);</pre>
490 <p>Copies session state from one connection to another. This is
491 not normally needed, but may be used when the same session
492 needs to be used between different endpoints as is required
493 by some protocols such as FTP over TLS. <em class="parameter"><code>source</code></em>
494  should have
495 already completed a handshake, and <em class="parameter"><code>conn</code></em>
496  should not have
497 completed a handshake.</p>
498 <div class="refsect3">
499 <a name="g-tls-client-connection-copy-session-state.parameters"></a><h4>Parameters</h4>
500 <div class="informaltable"><table class="informaltable" width="100%" border="0">
501 <colgroup>
502 <col width="150px" class="parameters_name">
503 <col class="parameters_description">
504 <col width="200px" class="parameters_annotations">
505 </colgroup>
506 <tbody>
507 <tr>
508 <td class="parameter_name"><p>conn</p></td>
509 <td class="parameter_description"><p>a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
510 <td class="parameter_annotations"> </td>
511 </tr>
512 <tr>
513 <td class="parameter_name"><p>source</p></td>
514 <td class="parameter_description"><p>a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a></p></td>
515 <td class="parameter_annotations"> </td>
516 </tr>
517 </tbody>
518 </table></div>
519 </div>
520 <p class="since">Since: <a class="link" href="api-index-2-46.html#api-index-2.46">2.46</a></p>
521 </div>
522 </div>
523 <div class="refsect1">
524 <a name="GTlsClientConnection.other_details"></a><h2>Types and Values</h2>
525 <div class="refsect2">
526 <a name="GTlsClientConnection-struct"></a><h3>GTlsClientConnection</h3>
527 <pre class="programlisting">typedef struct _GTlsClientConnection GTlsClientConnection;</pre>
528 <p>Abstract base class for the backend-specific client connection
529 type.</p>
530 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
531 </div>
532 <hr>
533 <div class="refsect2">
534 <a name="GTlsClientConnectionInterface"></a><h3>struct GTlsClientConnectionInterface</h3>
535 <pre class="programlisting">struct GTlsClientConnectionInterface {
536   GTypeInterface g_iface;
537
538   void     ( *copy_session_state )     (GTlsClientConnection       *conn,
539                                         GTlsClientConnection       *source);
540 };
541 </pre>
542 <p>vtable for a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> implementation.</p>
543 <div class="refsect3">
544 <a name="GTlsClientConnectionInterface.members"></a><h4>Members</h4>
545 <div class="informaltable"><table class="informaltable" width="100%" border="0">
546 <colgroup>
547 <col width="300px" class="struct_members_name">
548 <col class="struct_members_description">
549 <col width="200px" class="struct_members_annotations">
550 </colgroup>
551 <tbody><tr>
552 <td class="struct_member_name"><p><em class="structfield"><code><a name="GTlsClientConnectionInterface.copy-session-state"></a>copy_session_state</code></em> ()</p></td>
553 <td class="struct_member_description"><p>Copies session state from one <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> to another.</p></td>
554 <td class="struct_member_annotations"> </td>
555 </tr></tbody>
556 </table></div>
557 </div>
558 <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
559 </div>
560 </div>
561 <div class="refsect1">
562 <a name="GTlsClientConnection.property-details"></a><h2>Property Details</h2>
563 <div class="refsect2">
564 <a name="GTlsClientConnection--accepted-cas"></a><h3>The <code class="literal">“accepted-cas”</code> property</h3>
565 <pre class="programlisting">  “accepted-cas”             <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a></pre>
566 <p>A list of the distinguished names of the Certificate Authorities
567 that the server will accept client certificates signed by. If the
568 server requests a client certificate during the handshake, then
569 this property will be set after the handshake completes.</p>
570 <p>Each item in the list is a <a href="../glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> which contains the complete
571 subject DN of the certificate authority.</p>
572 <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GLib.ByteArray]</span></p>
573 <p>Flags: Read</p>
574 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
575 </div>
576 <hr>
577 <div class="refsect2">
578 <a name="GTlsClientConnection--server-identity"></a><h3>The <code class="literal">“server-identity”</code> property</h3>
579 <pre class="programlisting">  “server-identity”          <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *</pre>
580 <p>A <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> describing the identity of the server that
581 is expected on the other end of the connection.</p>
582 <p>If the <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-BAD-IDENTITY:CAPS"><code class="literal">G_TLS_CERTIFICATE_BAD_IDENTITY</code></a> flag is set in
583 <a class="link" href="GTlsClientConnection.html#GTlsClientConnection--validation-flags" title="The “validation-flags” property"><span class="type">“validation-flags”</span></a>, this object will be used
584 to determine the expected identify of the remote end of the
585 connection; if <a class="link" href="GTlsClientConnection.html#GTlsClientConnection--server-identity" title="The “server-identity” property"><span class="type">“server-identity”</span></a> is not set,
586 or does not match the identity presented by the server, then the
587 <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-BAD-IDENTITY:CAPS"><code class="literal">G_TLS_CERTIFICATE_BAD_IDENTITY</code></a> validation will fail.</p>
588 <p>In addition to its use in verifying the server certificate,
589 this is also used to give a hint to the server about what
590 certificate we expect, which is useful for servers that serve
591 virtual hosts.</p>
592 <p>Flags: Read / Write / Construct</p>
593 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
594 </div>
595 <hr>
596 <div class="refsect2">
597 <a name="GTlsClientConnection--use-ssl3"></a><h3>The <code class="literal">“use-ssl3”</code> property</h3>
598 <pre class="programlisting">  “use-ssl3”                 <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
599 <p>If <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, tells the connection to use a fallback version of TLS
600 or SSL, rather than trying to negotiate the best version of TLS
601 to use. This can be used when talking to servers that don't
602 implement version negotiation correctly and therefore refuse to
603 handshake at all with a "modern" TLS handshake.</p>
604 <p>Despite the property name, the fallback version is not
605 necessarily SSL 3.0; if SSL 3.0 has been disabled, the
606 <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> will use the next highest available version
607 (normally TLS 1.0) as the fallback version.</p>
608 <p>Flags: Read / Write / Construct</p>
609 <p>Default value: FALSE</p>
610 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
611 </div>
612 <hr>
613 <div class="refsect2">
614 <a name="GTlsClientConnection--validation-flags"></a><h3>The <code class="literal">“validation-flags”</code> property</h3>
615 <pre class="programlisting">  “validation-flags”         <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></pre>
616 <p>What steps to perform when validating a certificate received from
617 a server. Server certificates that fail to validate in all of the
618 ways indicated here will be rejected unless the application
619 overrides the default via <a class="link" href="GTlsConnection.html#GTlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">“accept-certificate”</span></a>.</p>
620 <p>Flags: Read / Write / Construct</p>
621 <p>Default value: G_TLS_CERTIFICATE_UNKNOWN_CA | G_TLS_CERTIFICATE_BAD_IDENTITY | G_TLS_CERTIFICATE_NOT_ACTIVATED | G_TLS_CERTIFICATE_EXPIRED | G_TLS_CERTIFICATE_REVOKED | G_TLS_CERTIFICATE_INSECURE | G_TLS_CERTIFICATE_GENERIC_ERROR</p>
622 <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
623 </div>
624 </div>
625 </div>
626 <div class="footer">
627 <hr>Generated by GTK-Doc V1.25.1</div>
628 </body>
629 </html>