1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/* Copyright (C) 2013 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glibmm/interface.h>
#include <giomm/tlsconnection.h>
#include <giomm/enums.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(gio/gio.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GTlsClientConnectionInterface GTlsClientConnectionInterface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
{
class GIOMM_API SocketConnectable;
/** TlsClientConnection - TLS client-side connection.
* TlsClientConnection is the client-side subclass of TlsConnection,
* representing a client-side TLS connection.
* @newin{2,36}
*/
class GIOMM_API TlsClientConnection
: public Glib::Interface,
public TlsConnection
{
_CLASS_INTERFACE(TlsClientConnection, GTlsClientConnection, G_TLS_CLIENT_CONNECTION, GTlsClientConnectionInterface, , , GIOMM_API)
_CUSTOM_CTOR_CAST
public:
//TODO: It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
//function because this is an interface.
#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsClientConnection>',`Glib::wrap(G_TLS_CLIENT_CONNECTION($3))')
_WRAP_METHOD(static Glib::RefPtr<TlsClientConnection> create(const Glib::RefPtr<IOStream>& base_io_stream, const Glib::RefPtr<const SocketConnectable>& server_identity{?}), g_tls_client_connection_new, errthrow)
_WRAP_METHOD(void set_server_identity(const Glib::RefPtr<SocketConnectable>& identity), g_tls_client_connection_set_server_identity)
_WRAP_METHOD(Glib::RefPtr<SocketConnectable> get_server_identity(), g_tls_client_connection_get_server_identity, refreturn)
_WRAP_METHOD(Glib::RefPtr<const SocketConnectable> get_server_identity() const, g_tls_client_connection_get_server_identity, constversion)
_WRAP_METHOD(void set_validation_flags(TlsCertificateFlags flags), g_tls_client_connection_set_validation_flags)
_WRAP_METHOD(TlsCertificateFlags get_validation_flags() const, g_tls_client_connection_get_validation_flags)
_WRAP_METHOD(void set_use_ssl3(bool use_ssl3 = true), g_tls_client_connection_set_use_ssl3,
deprecated "SSL 3.0 is insecure, and this function does not generally enable or disable it, despite its name.")
_WRAP_METHOD(bool get_use_ssl3() const, g_tls_client_connection_get_use_ssl3,
deprecated "SSL 3.0 is insecure, and this function does not actually indicate whether it is enabled.")
#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Glib::ByteArray> >',`Glib::ListHandler< Glib::RefPtr<Glib::ByteArray> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector< Glib::RefPtr<Glib::ByteArray> > get_accepted_cas(), g_tls_client_connection_get_accepted_cas)
#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Glib::ByteArray> >',`Glib::ListHandler< Glib::RefPtr<const Glib::ByteArray> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector< Glib::RefPtr<const Glib::ByteArray> > get_accepted_cas() const, g_tls_client_connection_get_accepted_cas)
_WRAP_METHOD(void copy_session_state(const Glib::RefPtr<TlsClientConnection>& source), g_tls_client_connection_copy_session_state)
// property_accepted_cas() won't work unless a Glib::Value<std::vector<Glib::RefPtr<Glib::ByteArray>>>
// specialization is added. Workaround: Use get_accepted_cas().
_WRAP_PROPERTY("accepted-cas", std::vector< Glib::RefPtr<Glib::ByteArray> >,
deprecated "property_accepted_cas() does not work. Use get_accepted_cas() instead.")
_WRAP_PROPERTY("server-identity", Glib::RefPtr<SocketConnectable>)
_WRAP_PROPERTY("use-ssl3", bool, deprecated "SSL 3.0 is insecure, and this property does not generally enable or disable it, despite its name.")
_WRAP_PROPERTY("validation-flags", TlsCertificateFlags)
};
} // namespace Gio
|