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 	 * Copies session state from one connection to another. This is
61 	 * not normally needed, but may be used when the same session
62 	 * needs to be used between different endpoints as is required
63 	 * by some protocols such as FTP over TLS. @source should have
64 	 * already completed a handshake, and @conn should not have
65 	 * completed a handshake.
66 	 *
67 	 * Params:
68 	 *     source = a #GTlsClientConnection
69 	 *
70 	 * Since: 2.46
71 	 */
72 	public void copySessionState(TlsClientConnectionIF source);
73 
74 	/**
75 	 * Gets the list of distinguished names of the Certificate Authorities
76 	 * that the server will accept certificates from. This will be set
77 	 * during the TLS handshake if the server requests a certificate.
78 	 * Otherwise, it will be %NULL.
79 	 *
80 	 * Each item in the list is a #GByteArray which contains the complete
81 	 * subject DN of the certificate authority.
82 	 *
83 	 * Returns: the list of
84 	 *     CA DNs. You should unref each element with g_byte_array_unref() and then
85 	 *     the free the list with g_list_free().
86 	 *
87 	 * Since: 2.28
88 	 */
89 	public ListG getAcceptedCas();
90 
91 	/**
92 	 * Gets @conn's expected server identity
93 	 *
94 	 * Returns: a #GSocketConnectable describing the
95 	 *     expected server identity, or %NULL if the expected identity is not
96 	 *     known.
97 	 *
98 	 * Since: 2.28
99 	 */
100 	public SocketConnectableIF getServerIdentity();
101 
102 	/**
103 	 * Gets whether @conn will force the lowest-supported TLS protocol
104 	 * version rather than attempt to negotiate the highest mutually-
105 	 * supported version of TLS; see g_tls_client_connection_set_use_ssl3().
106 	 *
107 	 * Deprecated: SSL 3.0 is insecure, and this function does not
108 	 * actually indicate whether it is enabled.
109 	 *
110 	 * Returns: whether @conn will use the lowest-supported TLS protocol version
111 	 *
112 	 * Since: 2.28
113 	 */
114 	public bool getUseSsl3();
115 
116 	/**
117 	 * Gets @conn's validation flags
118 	 *
119 	 * Returns: the validation flags
120 	 *
121 	 * Since: 2.28
122 	 */
123 	public GTlsCertificateFlags getValidationFlags();
124 
125 	/**
126 	 * Sets @conn's expected server identity, which is used both to tell
127 	 * servers on virtual hosts which certificate to present, and also
128 	 * to let @conn know what name to look for in the certificate when
129 	 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
130 	 *
131 	 * Params:
132 	 *     identity = a #GSocketConnectable describing the expected server identity
133 	 *
134 	 * Since: 2.28
135 	 */
136 	public void setServerIdentity(SocketConnectableIF identity);
137 
138 	/**
139 	 * Since 2.42.1, if @use_ssl3 is %TRUE, this forces @conn to use the
140 	 * lowest-supported TLS protocol version rather than trying to properly
141 	 * negotiate the highest mutually-supported protocol version with the
142 	 * peer. Be aware that SSL 3.0 is generally disabled by the
143 	 * #GTlsBackend, so the lowest-supported protocol version is probably
144 	 * not SSL 3.0.
145 	 *
146 	 * Since 2.58, this may additionally cause an RFC 7507 fallback SCSV to
147 	 * be sent to the server, causing modern TLS servers to immediately
148 	 * terminate the connection. You should generally only use this function
149 	 * if you need to connect to broken servers that exhibit TLS protocol
150 	 * version intolerance, and when an initial attempt to connect to a
151 	 * server normally has already failed.
152 	 *
153 	 * Deprecated: SSL 3.0 is insecure, and this function does not
154 	 * generally enable or disable it, despite its name.
155 	 *
156 	 * Params:
157 	 *     useSsl3 = whether to use the lowest-supported protocol version
158 	 *
159 	 * Since: 2.28
160 	 */
161 	public void setUseSsl3(bool useSsl3);
162 
163 	/**
164 	 * Sets @conn's validation flags, to override the default set of
165 	 * checks performed when validating a server certificate. By default,
166 	 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
167 	 *
168 	 * Params:
169 	 *     flags = the #GTlsCertificateFlags to use
170 	 *
171 	 * Since: 2.28
172 	 */
173 	public void setValidationFlags(GTlsCertificateFlags flags);
174 }