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