Class: Gio::TlsConnection
- Inherits:
-
Object
- Object
- Gio::TlsConnection
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#advertised_protocols ⇒ Gio::
The list of application-layer protocols that the connection advertises that it is willing to speak.
-
#advertised_protocols=(advertised_protocols) ⇒ Gio::
The list of application-layer protocols that the connection advertises that it is willing to speak.
-
#base_io_stream ⇒ Gio::IOStream
The #GIOStream that the connection wraps.
-
#base_io_stream=(base_io_stream) ⇒ Gio::IOStream
The #GIOStream that the connection wraps.
-
#certificate ⇒ Gio::TlsCertificate
The connection’s certificate; see g_tls_connection_set_certificate().
-
#certificate=(certificate) ⇒ Gio::TlsCertificate
The connection’s certificate; see g_tls_connection_set_certificate().
-
#database ⇒ Gio::TlsDatabase
The certificate database to use when verifying this TLS connection.
-
#database=(database) ⇒ Gio::TlsDatabase
The certificate database to use when verifying this TLS connection.
-
#emit_accept_certificate(peer_cert, errors) ⇒ TrueClass
Used by GTls::Connection implementations to emit the GTls::Connection::accept-certificate signal.
-
#handshake(cancellable) ⇒ TrueClass
Attempts a TLS handshake on conn.
-
#handshake_async(io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously performs a TLS handshake on conn.
-
#handshake_finish(result) ⇒ TrueClass
Finish an asynchronous TLS handshake operation.
-
#interaction ⇒ Gio::TlsInteraction
A GTls::Interaction object to be used when the connection or certificate database need to interact with the user.
-
#interaction=(interaction) ⇒ Gio::TlsInteraction
A GTls::Interaction object to be used when the connection or certificate database need to interact with the user.
-
#negotiated_protocol ⇒ String
The application-layer protocol negotiated during the TLS handshake.
-
#negotiated_protocol=(negotiated_protocol) ⇒ String
The application-layer protocol negotiated during the TLS handshake.
-
#peer_certificate ⇒ Gio::TlsCertificate
The connection’s peer’s certificate, after the TLS handshake has completed and the certificate has been accepted.
-
#peer_certificate=(peer_certificate) ⇒ Gio::TlsCertificate
The connection’s peer’s certificate, after the TLS handshake has completed and the certificate has been accepted.
-
#peer_certificate_errors ⇒ Gio::TlsCertificateFlags
The errors noticed-and-ignored while verifying GTls::Connection:peer-certificate.
-
#peer_certificate_errors=(peer_certificate_errors) ⇒ Gio::TlsCertificateFlags
The errors noticed-and-ignored while verifying GTls::Connection:peer-certificate.
-
#rehandshake_mode ⇒ Gio::TlsRehandshakeMode
The rehandshaking mode.
-
#rehandshake_mode=(rehandshake_mode) ⇒ Gio::TlsRehandshakeMode
The rehandshaking mode.
-
#require_close_notify ⇒ TrueClass
Tests whether or not conn expects a proper TLS close notification when the connection is closed.
-
#require_close_notify=(require_close_notify) ⇒ TrueClass
Whether or not proper TLS close notification is required.
-
#require_close_notify? ⇒ TrueClass
Whether or not proper TLS close notification is required.
-
#use_system_certdb ⇒ TrueClass
Gets whether conn uses the system certificate database to verify peer certificates.
-
#use_system_certdb=(use_system_certdb) ⇒ TrueClass
Whether or not the system certificate database will be used to verify peer certificates.
-
#use_system_certdb? ⇒ TrueClass
Whether or not the system certificate database will be used to verify peer certificates.
Instance Method Details
#advertised_protocols ⇒ Gio::
The list of application-layer protocols that the connection advertises that it is willing to speak. See g_tls_connection_set_advertised_protocols().
#advertised_protocols=(advertised_protocols) ⇒ Gio::
The list of application-layer protocols that the connection advertises that it is willing to speak. See g_tls_connection_set_advertised_protocols().
#base_io_stream ⇒ Gio::IOStream
The #GIOStream that the connection wraps. The connection holds a reference to this stream, and may run operations on the stream from other threads throughout its lifetime. Consequently, after the #GIOStream has been constructed, application code may only run its own operations on this stream when no #GIOStream operations are running.
#base_io_stream=(base_io_stream) ⇒ Gio::IOStream
The #GIOStream that the connection wraps. The connection holds a reference to this stream, and may run operations on the stream from other threads throughout its lifetime. Consequently, after the #GIOStream has been constructed, application code may only run its own operations on this stream when no #GIOStream operations are running.
#certificate ⇒ Gio::TlsCertificate
The connection’s certificate; see g_tls_connection_set_certificate().
#certificate=(certificate) ⇒ Gio::TlsCertificate
The connection’s certificate; see g_tls_connection_set_certificate().
#database ⇒ Gio::TlsDatabase
The certificate database to use when verifying this TLS connection. If no certificate database is set, then the default database will be used. See g_tls_backend_get_default_database().
#database=(database) ⇒ Gio::TlsDatabase
The certificate database to use when verifying this TLS connection. If no certificate database is set, then the default database will be used. See g_tls_backend_get_default_database().
#emit_accept_certificate(peer_cert, errors) ⇒ TrueClass
Used by GTls::Connection implementations to emit the GTls::Connection::accept-certificate signal.
#handshake(cancellable) ⇒ TrueClass
Attempts a TLS handshake on conn.
On the client side, it is never necessary to call this method; although the connection needs to perform a handshake after connecting (or after sending a “STARTTLS”-type command), GTls::Connection will handle this for you automatically when you try to send or receive data on the connection. You can call g_tls_connection_handshake() manually if you want to know whether the initial handshake succeeded or failed (as opposed to just immediately trying to use conn to read or write, in which case, if it fails, it may not be possible to tell if it failed before or after completing the handshake), but beware that servers may reject client authentication after the handshake has completed, so a successful handshake does not indicate the connection will be usable.
Likewise, on the server side, although a handshake is necessary at the beginning of the communication, you do not need to call this function explicitly unless you want clearer error reporting.
Previously, calling g_tls_connection_handshake() after the initial handshake would trigger a rehandshake; however, this usage was deprecated in GLib 2.60 because rehandshaking was removed from the TLS protocol in TLS 1.3. Since GLib 2.64, calling this function after the initial handshake will no longer do anything.
When using a GTls::Connection created by #GSocketClient, the GSocket::Client performs the initial handshake, so calling this function manually is not recommended.
GTls::Connection::accept_certificate may be emitted during the handshake.
#handshake_async(io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously performs a TLS handshake on conn. See g_tls_connection_handshake() for more information.
#handshake_finish(result) ⇒ TrueClass
Finish an asynchronous TLS handshake operation. See g_tls_connection_handshake() for more information. case error will be set.
#interaction ⇒ Gio::TlsInteraction
A GTls::Interaction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.
#interaction=(interaction) ⇒ Gio::TlsInteraction
A GTls::Interaction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.
#negotiated_protocol ⇒ String
The application-layer protocol negotiated during the TLS handshake. See g_tls_connection_get_negotiated_protocol().
#negotiated_protocol=(negotiated_protocol) ⇒ String
The application-layer protocol negotiated during the TLS handshake. See g_tls_connection_get_negotiated_protocol().
#peer_certificate ⇒ Gio::TlsCertificate
The connection’s peer’s certificate, after the TLS handshake has completed and the certificate has been accepted. Note in particular that this is not yet set during the emission of GTls::Connection::accept-certificate.
(You can watch for a #GObject::notify signal on this property to detect when a handshake has occurred.)
#peer_certificate=(peer_certificate) ⇒ Gio::TlsCertificate
The connection’s peer’s certificate, after the TLS handshake has completed and the certificate has been accepted. Note in particular that this is not yet set during the emission of GTls::Connection::accept-certificate.
(You can watch for a #GObject::notify signal on this property to detect when a handshake has occurred.)
#peer_certificate_errors ⇒ Gio::TlsCertificateFlags
The errors noticed-and-ignored while verifying GTls::Connection:peer-certificate. Normally this should be 0, but it may not be if GTls::ClientConnection:validation-flags is not %G_TLS_CERTIFICATE_VALIDATE_ALL, or if GTls::Connection::accept-certificate overrode the default behavior.
#peer_certificate_errors=(peer_certificate_errors) ⇒ Gio::TlsCertificateFlags
The errors noticed-and-ignored while verifying GTls::Connection:peer-certificate. Normally this should be 0, but it may not be if GTls::ClientConnection:validation-flags is not %G_TLS_CERTIFICATE_VALIDATE_ALL, or if GTls::Connection::accept-certificate overrode the default behavior.
#rehandshake_mode ⇒ Gio::TlsRehandshakeMode
The rehandshaking mode. See g_tls_connection_set_rehandshake_mode().
#rehandshake_mode=(rehandshake_mode) ⇒ Gio::TlsRehandshakeMode
The rehandshaking mode. See g_tls_connection_set_rehandshake_mode().
#require_close_notify ⇒ TrueClass
Tests whether or not conn expects a proper TLS close notification when the connection is closed. See g_tls_connection_set_require_close_notify() for details. notification.
#require_close_notify=(require_close_notify) ⇒ TrueClass
Whether or not proper TLS close notification is required. See g_tls_connection_set_require_close_notify().
#require_close_notify? ⇒ TrueClass
Whether or not proper TLS close notification is required. See g_tls_connection_set_require_close_notify().
#use_system_certdb ⇒ TrueClass
Gets whether conn uses the system certificate database to verify peer certificates. See g_tls_connection_set_use_system_certdb().
#use_system_certdb=(use_system_certdb) ⇒ TrueClass
Whether or not the system certificate database will be used to verify peer certificates. See g_tls_connection_set_use_system_certdb().
#use_system_certdb? ⇒ TrueClass
Whether or not the system certificate database will be used to verify peer certificates. See g_tls_connection_set_use_system_certdb().