1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.TlsClientConnectionIF;
26 
27 private import gio.IOStream;
28 private import gio.SocketConnectable;
29 private import gio.SocketConnectableIF;
30 private import glib.ConstructionException;
31 private import glib.ErrorG;
32 private import glib.GException;
33 private import glib.ListG;
34 private import gobject.ObjectG;
35 private import gtkc.gio;
36 public  import gtkc.giotypes;
37 
38 
39 /**
40  * #GTlsClientConnection is the client-side subclass of
41  * #GTlsConnection, representing a client-side TLS connection.
42  *
43  * Since: 2.28
44  */
45 public interface TlsClientConnectionIF{
46 	/** Get the main Gtk struct */
47 	public GTlsClientConnection* getTlsClientConnectionStruct();
48 
49 	/** the main Gtk struct as a void* */
50 	protected void* getStruct();
51 
52 	/**
53 	 */
54 
55 	/**
56 	 * Copies session state from one connection to another. This is
57 	 * not normally needed, but may be used when the same session
58 	 * needs to be used between different endpoints as is required
59 	 * by some protocols such as FTP over TLS. @source should have
60 	 * already completed a handshake, and @conn should not have
61 	 * completed a handshake.
62 	 *
63 	 * Params:
64 	 *     source = a #GTlsClientConnection
65 	 *
66 	 * Since: 2.46
67 	 */
68 	public void copySessionState(TlsClientConnectionIF source);
69 
70 	/**
71 	 * Gets the list of distinguished names of the Certificate Authorities
72 	 * that the server will accept certificates from. This will be set
73 	 * during the TLS handshake if the server requests a certificate.
74 	 * Otherwise, it will be %NULL.
75 	 *
76 	 * Each item in the list is a #GByteArray which contains the complete
77 	 * subject DN of the certificate authority.
78 	 *
79 	 * Return: the list of
80 	 *     CA DNs. You should unref each element with g_byte_array_unref() and then
81 	 *     the free the list with g_list_free().
82 	 *
83 	 * Since: 2.28
84 	 */
85 	public ListG getAcceptedCas();
86 
87 	/**
88 	 * Gets @conn's expected server identity
89 	 *
90 	 * Return: a #GSocketConnectable describing the
91 	 *     expected server identity, or %NULL if the expected identity is not
92 	 *     known.
93 	 *
94 	 * Since: 2.28
95 	 */
96 	public SocketConnectableIF getServerIdentity();
97 
98 	/**
99 	 * Gets whether @conn will use SSL 3.0 rather than the
100 	 * highest-supported version of TLS; see
101 	 * g_tls_client_connection_set_use_ssl3().
102 	 *
103 	 * Return: whether @conn will use SSL 3.0
104 	 *
105 	 * Since: 2.28
106 	 */
107 	public bool getUseSsl3();
108 
109 	/**
110 	 * Gets @conn's validation flags
111 	 *
112 	 * Return: the validation flags
113 	 *
114 	 * Since: 2.28
115 	 */
116 	public GTlsCertificateFlags getValidationFlags();
117 
118 	/**
119 	 * Sets @conn's expected server identity, which is used both to tell
120 	 * servers on virtual hosts which certificate to present, and also
121 	 * to let @conn know what name to look for in the certificate when
122 	 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
123 	 *
124 	 * Params:
125 	 *     identity = a #GSocketConnectable describing the expected server identity
126 	 *
127 	 * Since: 2.28
128 	 */
129 	public void setServerIdentity(SocketConnectableIF identity);
130 
131 	/**
132 	 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
133 	 * trying to properly negotiate the right version of TLS or SSL to use.
134 	 * This can be used when talking to servers that do not implement the
135 	 * fallbacks correctly and which will therefore fail to handshake with
136 	 * a "modern" TLS handshake attempt.
137 	 *
138 	 * Params:
139 	 *     useSsl3 = whether to use SSL 3.0
140 	 *
141 	 * Since: 2.28
142 	 */
143 	public void setUseSsl3(bool useSsl3);
144 
145 	/**
146 	 * Sets @conn's validation flags, to override the default set of
147 	 * checks performed when validating a server certificate. By default,
148 	 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
149 	 *
150 	 * Params:
151 	 *     flags = the #GTlsCertificateFlags to use
152 	 *
153 	 * Since: 2.28
154 	 */
155 	public void setValidationFlags(GTlsCertificateFlags flags);
156 }