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.SocketConnectableIF;
29 private import gio.c.functions;
30 public  import gio.c.types;
31 private import glib.ConstructionException;
32 private import glib.ErrorG;
33 private import glib.GException;
34 private import glib.ListG;
35 private import gobject.ObjectG;
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(bool transferOwnership = false);
48 
49 	/** the main Gtk struct as a void* */
50 	protected void* getStruct();
51 
52 
53 	/** */
54 	public static GType getType()
55 	{
56 		return g_tls_client_connection_get_type();
57 	}
58 
59 	/**
60 	 * Possibly copies session state from one connection to another, for use
61 	 * in TLS session resumption. This is not normally needed, but may be
62 	 * used when the same session needs to be used between different
63 	 * endpoints, as is required by some protocols, such as FTP over TLS.
64 	 * @source should have already completed a handshake and, since TLS 1.3,
65 	 * it should have been used to read data at least once. @conn should not
66 	 * have completed a handshake.
67 	 *
68 	 * It is not possible to know whether a call to this function will
69 	 * actually do anything. Because session resumption is normally used
70 	 * only for performance benefit, the TLS backend might not implement
71 	 * this function. Even if implemented, it may not actually succeed in
72 	 * allowing @conn to resume @source's TLS session, because the server
73 	 * may not have sent a session resumption token to @source, or it may
74 	 * refuse to accept the token from @conn. There is no way to know
75 	 * whether a call to this function is actually successful.
76 	 *
77 	 * Using this function is not required to benefit from session
78 	 * resumption. If the TLS backend supports session resumption, the
79 	 * session will be resumed automatically if it is possible to do so
80 	 * without weakening the privacy guarantees normally provided by TLS,
81 	 * without need to call this function. For example, with TLS 1.3,
82 	 * a session ticket will be automatically copied from any
83 	 * #GTlsClientConnection that has previously received session tickets
84 	 * from the server, provided a ticket is available that has not
85 	 * previously been used for session resumption, since session ticket
86 	 * reuse would be a privacy weakness. Using this function causes the
87 	 * ticket to be copied without regard for privacy considerations.
88 	 *
89 	 * Params:
90 	 *     source = a #GTlsClientConnection
91 	 *
92 	 * Since: 2.46
93 	 */
94 	public void copySessionState(TlsClientConnectionIF source);
95 
96 	/**
97 	 * Gets the list of distinguished names of the Certificate Authorities
98 	 * that the server will accept certificates from. This will be set
99 	 * during the TLS handshake if the server requests a certificate.
100 	 * Otherwise, it will be %NULL.
101 	 *
102 	 * Each item in the list is a #GByteArray which contains the complete
103 	 * subject DN of the certificate authority.
104 	 *
105 	 * Returns: the list of
106 	 *     CA DNs. You should unref each element with g_byte_array_unref() and then
107 	 *     the free the list with g_list_free().
108 	 *
109 	 * Since: 2.28
110 	 */
111 	public ListG getAcceptedCas();
112 
113 	/**
114 	 * Gets @conn's expected server identity
115 	 *
116 	 * Returns: a #GSocketConnectable describing the
117 	 *     expected server identity, or %NULL if the expected identity is not
118 	 *     known.
119 	 *
120 	 * Since: 2.28
121 	 */
122 	public SocketConnectableIF getServerIdentity();
123 
124 	/**
125 	 * SSL 3.0 is no longer supported. See
126 	 * g_tls_client_connection_set_use_ssl3() for details.
127 	 *
128 	 * Deprecated: SSL 3.0 is insecure.
129 	 *
130 	 * Returns: %FALSE
131 	 *
132 	 * Since: 2.28
133 	 */
134 	public bool getUseSsl3();
135 
136 	/**
137 	 * Gets @conn's validation flags
138 	 *
139 	 * Returns: the validation flags
140 	 *
141 	 * Since: 2.28
142 	 */
143 	public GTlsCertificateFlags getValidationFlags();
144 
145 	/**
146 	 * Sets @conn's expected server identity, which is used both to tell
147 	 * servers on virtual hosts which certificate to present, and also
148 	 * to let @conn know what name to look for in the certificate when
149 	 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
150 	 *
151 	 * Params:
152 	 *     identity = a #GSocketConnectable describing the expected server identity
153 	 *
154 	 * Since: 2.28
155 	 */
156 	public void setServerIdentity(SocketConnectableIF identity);
157 
158 	/**
159 	 * Since GLib 2.42.1, SSL 3.0 is no longer supported.
160 	 *
161 	 * From GLib 2.42.1 through GLib 2.62, this function could be used to
162 	 * force use of TLS 1.0, the lowest-supported TLS protocol version at
163 	 * the time. In the past, this was needed to connect to broken TLS
164 	 * servers that exhibited protocol version intolerance. Such servers
165 	 * are no longer common, and using TLS 1.0 is no longer considered
166 	 * acceptable.
167 	 *
168 	 * Since GLib 2.64, this function does nothing.
169 	 *
170 	 * Deprecated: SSL 3.0 is insecure.
171 	 *
172 	 * Params:
173 	 *     useSsl3 = a #gboolean, ignored
174 	 *
175 	 * Since: 2.28
176 	 */
177 	public void setUseSsl3(bool useSsl3);
178 
179 	/**
180 	 * Sets @conn's validation flags, to override the default set of
181 	 * checks performed when validating a server certificate. By default,
182 	 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
183 	 *
184 	 * Params:
185 	 *     flags = the #GTlsCertificateFlags to use
186 	 *
187 	 * Since: 2.28
188 	 */
189 	public void setValidationFlags(GTlsCertificateFlags flags);
190 }