glibmm 2.66.8
Gio::TlsServerConnection Class Reference

TlsServerConnection - TLS server-side connection. More...

#include <giomm/tlsserverconnection.h>

Inheritance diagram for Gio::TlsServerConnection:

Public Member Functions

 TlsServerConnection (TlsServerConnection && src) noexcept
 
TlsServerConnectionoperator= (TlsServerConnection && src) noexcept
 
 ~TlsServerConnection () noexcept override
 
GTlsServerConnection * gobj ()
 Provides access to the underlying C GObject.
 
const GTlsServerConnection * gobj () const
 Provides access to the underlying C GObject.
 
Glib::PropertyProxy< TlsAuthenticationModeproperty_authentication_mode ()
 The TlsAuthenticationMode for the server.
 
Glib::PropertyProxy_ReadOnly< TlsAuthenticationModeproperty_authentication_mode () const
 The TlsAuthenticationMode for the server.
 
- Public Member Functions inherited from Glib::Interface
 Interface ()
 A Default constructor.
 
 Interface (Interface && src) noexcept
 
Interfaceoperator= (Interface && src) noexcept
 
 Interface (const Glib::Interface_Class & interface_class)
 Called by constructors of derived classes.
 
 Interface (GObject * castitem)
 Called by constructors of derived classes.
 
 ~Interface () noexcept override
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
GObject * gobj ()
 
const GObject * gobj () const
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value)
 You probably want to use a specific property_*() accessor method instead.
 
void get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const
 You probably want to use a specific property_*() accessor method instead.
 
template<class PropertyType>
void set_property (const Glib::ustring & property_name, const PropertyType & value)
 You probably want to use a specific property_*() accessor method instead.
 
template<class PropertyType>
void get_property (const Glib::ustring & property_name, PropertyType & value) const
 You probably want to use a specific property_*() accessor method instead.
 
void connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void > & slot)
 You can use the signal_changed() signal of the property proxy instead.
 
void connect_property_changed (const Glib::ustring & property_name, sigc::slot< void > && slot)
 You can use the signal_changed() signal of the property proxy instead.
 
sigc::connection connect_property_changed_with_return (const Glib::ustring & property_name, const sigc::slot< void > & slot)
 You can use the signal_changed() signal of the property proxy instead.
 
sigc::connection connect_property_changed_with_return (const Glib::ustring & property_name, sigc::slot< void > && slot)
 You can use the signal_changed() signal of the property proxy instead.
 
void freeze_notify ()
 Increases the freeze count on object.
 
void thaw_notify ()
 Reverts the effect of a previous call to freeze_notify().
 
virtual void reference () const
 Increment the reference count for this object.
 
virtual void unreference () const
 Decrement the reference count for this object.
 
GObject * gobj ()
 Provides access to the underlying C GObject.
 
const GObject * gobj () const
 Provides access to the underlying C GObject.
 
GObject * gobj_copy () const
 Give a ref-ed copy to someone. Use for direct struct access.
 
- Public Member Functions inherited from Gio::TlsConnection
 TlsConnection (TlsConnection && src) noexcept
 
TlsConnectionoperator= (TlsConnection && src) noexcept
 
 ~TlsConnection () noexcept override
 
GTlsConnection * gobj ()
 Provides access to the underlying C GObject.
 
const GTlsConnection * gobj () const
 Provides access to the underlying C GObject.
 
GTlsConnection * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
void set_certificate (const Glib::RefPtr< TlsCertificate > & certificate)
 This sets the certificate that conn will present to its peer during the TLS handshake.
 
Glib::RefPtr< TlsCertificateget_certificate ()
 Gets conn's certificate, as set by g_tls_connection_set_certificate().
 
Glib::RefPtr< const TlsCertificateget_certificate () const
 Gets conn's certificate, as set by g_tls_connection_set_certificate().
 
Glib::RefPtr< TlsCertificateget_peer_certificate ()
 Gets conn's peer's certificate after the handshake has completed or failed.
 
Glib::RefPtr< const TlsCertificateget_peer_certificate () const
 Gets conn's peer's certificate after the handshake has completed or failed.
 
TlsCertificateFlags get_peer_certificate_errors () const
 Gets the errors associated with validating conn's peer's certificate, after the handshake has completed or failed.
 
void set_require_close_notify (bool require_close_notify=true)
 Sets whether or not conn expects a proper TLS close notification before the connection is closed.
 
bool get_require_close_notify () const
 Tests whether or not conn expects a proper TLS close notification when the connection is closed.
 
void set_rehandshake_mode (TlsRehandshakeMode mode)
 Since GLib 2.64, changing the rehandshake mode is no longer supported and will have no effect.
 
TlsRehandshakeMode get_rehandshake_mode () const
 Gets conn rehandshaking mode.
 
void set_use_system_certdb (bool use_system_certdb=true)
 Sets whether conn uses the system certificate database to verify peer certificates.
 
bool get_use_system_certdb () const
 Gets whether conn uses the system certificate database to verify peer certificates.
 
Glib::RefPtr< TlsDatabaseget_database ()
 Gets the certificate database that conn uses to verify peer certificates.
 
Glib::RefPtr< const TlsDatabaseget_database () const
 Gets the certificate database that conn uses to verify peer certificates.
 
void set_database (const Glib::RefPtr< TlsDatabase > & database)
 Sets the certificate database that is used to verify peer certificates.
 
Glib::RefPtr< TlsInteractionget_interaction ()
 Get the object that will be used to interact with the user.
 
Glib::RefPtr< const TlsInteractionget_interaction () const
 Get the object that will be used to interact with the user.
 
void set_interaction (const Glib::RefPtr< TlsInteraction > & interaction)
 Set the object that will be used to interact with the user.
 
bool handshake (const Glib::RefPtr< Cancellable > & cancellable)
 Attempts a TLS handshake on conn.
 
bool handshake ()
 A handshake() convenience overload.
 
void handshake_async (const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, int io_priority=Glib::PRIORITY_DEFAULT)
 Asynchronously performs a TLS handshake on conn.
 
void handshake_async (const SlotAsyncReady & slot, int io_priority=Glib::PRIORITY_DEFAULT)
 A handshake_async() convenience overload.
 
bool handshake_finish (const Glib::RefPtr< AsyncResult > & result)
 Finish an asynchronous TLS handshake operation.
 
bool emit_accept_certificate (const Glib::RefPtr< const TlsCertificate > & peer_cert, TlsCertificateFlags errors)
 Used by TlsConnection implementations to emit the TlsConnection::signal_accept_certificate() signal.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< IOStream > > property_base_io_stream () const
 The IOStream that the connection wraps.
 
Glib::PropertyProxy< Glib::RefPtr< TlsCertificate > > property_certificate ()
 The connection's certificate; see g_tls_connection_set_certificate().
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TlsCertificate > > property_certificate () const
 The connection's certificate; see g_tls_connection_set_certificate().
 
Glib::PropertyProxy< Glib::RefPtr< TlsDatabase > > property_database ()
 The certificate database to use when verifying this TLS connection.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TlsDatabase > > property_database () const
 The certificate database to use when verifying this TLS connection.
 
Glib::PropertyProxy< Glib::RefPtr< TlsInteraction > > property_interaction ()
 A TlsInteraction object to be used when the connection or certificate database need to interact with the user.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TlsInteraction > > property_interaction () const
 A TlsInteraction object to be used when the connection or certificate database need to interact with the user.
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TlsCertificate > > property_peer_certificate () const
 The connection's peer's certificate, after the TLS handshake has completed or failed.
 
Glib::PropertyProxy_ReadOnly< TlsCertificateFlagsproperty_peer_certificate_errors () const
 The errors noticed while verifying TlsConnection::property_peer_certificate().
 
Glib::PropertyProxy< TlsRehandshakeModeproperty_rehandshake_mode ()
 The rehandshaking mode.
 
Glib::PropertyProxy_ReadOnly< TlsRehandshakeModeproperty_rehandshake_mode () const
 The rehandshaking mode.
 
Glib::PropertyProxy< bool > property_require_close_notify ()
 Whether or not proper TLS close notification is required.
 
Glib::PropertyProxy_ReadOnly< bool > property_require_close_notify () const
 Whether or not proper TLS close notification is required.
 
Glib::PropertyProxy< bool > property_use_system_certdb ()
 Whether or not the system certificate database will be used to verify peer certificates.
 
Glib::PropertyProxy_ReadOnly< bool > property_use_system_certdb () const
 Whether or not the system certificate database will be used to verify peer certificates.
 
Glib::SignalProxy< bool, const Glib::RefPtr< const TlsCertificate > &, TlsCertificateFlagssignal_accept_certificate ()
 
virtual bool handshake_vfunc (const Glib::RefPtr< Cancellable > & cancellable)
 
virtual void handshake_async_vfunc (const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, int io_priority)
 
virtual bool handshake_finish_vfunc (const Glib::RefPtr< AsyncResult > & result)
 
- Public Member Functions inherited from Gio::IOStream
 IOStream (IOStream && src) noexcept
 
IOStreamoperator= (IOStream && src) noexcept
 
 ~IOStream () noexcept override
 
GIOStream * gobj ()
 Provides access to the underlying C GObject.
 
const GIOStream * gobj () const
 Provides access to the underlying C GObject.
 
GIOStream * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
void splice_async (const Glib::RefPtr< IOStream > & stream2, const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, IOStreamSpliceFlags flags=Gio::IO_STREAM_SPLICE_NONE, int io_priority=Glib::PRIORITY_DEFAULT)
 Asyncronously splice the output stream to the input stream of stream2, and splice the output stream of stream2 to the input stream of this stream.
 
void splice_async (const Glib::RefPtr< IOStream > & stream2, const SlotAsyncReady & slot, IOStreamSpliceFlags flags=Gio::IO_STREAM_SPLICE_NONE, int io_priority=Glib::PRIORITY_DEFAULT)
 A non-cancellable version of splice_async().
 
Glib::RefPtr< InputStreamget_input_stream ()
 Gets the input stream for this object.
 
Glib::RefPtr< OutputStreamget_output_stream ()
 Gets the output stream for this object.
 
bool close (const Glib::RefPtr< Cancellable > & cancellable)
 Closes the stream, releasing resources related to it.
 
bool close ()
 A close() convenience overload.
 
void close_async (const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, int io_priority=Glib::PRIORITY_DEFAULT)
 
void close_async (const SlotAsyncReady & slot, int io_priority=Glib::PRIORITY_DEFAULT)
 
bool close_finish (const Glib::RefPtr< AsyncResult > & result)
 Closes a stream.
 
bool is_closed () const
 Checks if a stream is closed.
 
bool has_pending () const
 Checks if a stream has pending actions.
 
bool set_pending ()
 Sets stream to have actions pending.
 
void clear_pending ()
 Clears the pending flag on stream.
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object && src) noexcept
 
Objectoperator= (Object && src) noexcept
 
void * get_data (const QueryQuark & key)
 
void set_data (const Quark & key, void *data)
 
void set_data (const Quark & key, void *data, DestroyNotify notify)
 
void remove_data (const QueryQuark & quark)
 
void * steal_data (const QueryQuark & quark)
 

Static Public Member Functions

static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< IOStreamcreate (const Glib::RefPtr< IOStream > & base_io_stream, const Glib::RefPtr< TlsCertificate > & certificate)
 Creates a new TlsServerConnection wrapping base_io_stream (which must have pollable input and output streams).
 
- Static Public Member Functions inherited from Gio::TlsConnection
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
- Static Public Member Functions inherited from Gio::IOStream
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static bool splice_finish (const Glib::RefPtr< AsyncResult > & result)
 Finishes an asynchronous io stream splice operation.
 

Protected Member Functions

 TlsServerConnection ()
 You should derive from this class to use it.
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
 
 ObjectBase (const char * custom_type_name)
 A derived constructor always overrides this choice.
 
 ObjectBase (const std::type_info & custom_type_info)
 This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually.
 
 ObjectBase (ObjectBase && src) noexcept
 
ObjectBaseoperator= (ObjectBase && src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject * castitem)
 
void initialize_move (GObject * castitem, Glib::ObjectBase * previous_wrapper)
 
- Protected Member Functions inherited from Gio::TlsConnection
 TlsConnection ()
 
virtual bool on_accept_certificate (const Glib::RefPtr< const TlsCertificate > & peer_cert, TlsCertificateFlags errors)
 This is a default handler for the signal signal_accept_certificate().
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams & construct_params)
 
 Object (GObject * castitem)
 
 ~Object () noexcept override
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< Gio::TlsServerConnectionwrap (GTlsServerConnection * object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Additional Inherited Members

- Public Types inherited from Glib::Object
using DestroyNotify = void (*)(gpointer data)
 

Detailed Description

TlsServerConnection - TLS server-side connection.

TlsServerConnection is the server-side subclass of TlsConnection, representing a server-side TLS connection.

Since glibmm 2.36

Constructor & Destructor Documentation

◆ TlsServerConnection() [1/2]

Gio::TlsServerConnection::TlsServerConnection ( )
protected

You should derive from this class to use it.

◆ TlsServerConnection() [2/2]

Gio::TlsServerConnection::TlsServerConnection ( TlsServerConnection && src)
noexcept

◆ ~TlsServerConnection()

Gio::TlsServerConnection::~TlsServerConnection ( )
overridenoexcept

Member Function Documentation

◆ add_interface()

static void Gio::TlsServerConnection::add_interface ( GType gtype_implementer)
static

◆ create()

static Glib::RefPtr< IOStream > Gio::TlsServerConnection::create ( const Glib::RefPtr< IOStream > & base_io_stream,
const Glib::RefPtr< TlsCertificate > & certificate )
static

Creates a new TlsServerConnection wrapping base_io_stream (which must have pollable input and output streams).

See the documentation for TlsConnection::property_base_io_stream() for restrictions on when application code can run operations on the base_io_stream after this function has returned.

Since glibmm 2.28
Parameters
base_io_streamThe IOStream to wrap.
certificateThe default server certificate, or nullptr.
Returns
The new TlsServerConnection, or nullptr on error.
Exceptions
Glib::Error

◆ get_type()

static GType Gio::TlsServerConnection::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GTlsServerConnection * Gio::TlsServerConnection::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GTlsServerConnection * Gio::TlsServerConnection::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ operator=()

TlsServerConnection & Gio::TlsServerConnection::operator= ( TlsServerConnection && src)
noexcept

◆ property_authentication_mode() [1/2]

Glib::PropertyProxy< TlsAuthenticationMode > Gio::TlsServerConnection::property_authentication_mode ( )

The TlsAuthenticationMode for the server.

This can be changed before calling g_tls_connection_handshake() if you want to rehandshake with a different mode from the initial handshake.

Since glibmm 2.28

Default value: TLS_AUTHENTICATION_NONE

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_authentication_mode() [2/2]

Glib::PropertyProxy_ReadOnly< TlsAuthenticationMode > Gio::TlsServerConnection::property_authentication_mode ( ) const

The TlsAuthenticationMode for the server.

This can be changed before calling g_tls_connection_handshake() if you want to rehandshake with a different mode from the initial handshake.

Since glibmm 2.28

Default value: TLS_AUTHENTICATION_NONE

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< Gio::TlsServerConnection > wrap ( GTlsServerConnection * object,
bool take_copy = false )
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.