Infinity.CertificateVerify¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
File containing certificates of known hosts |
||
r/w/co |
The XMPP manager of registered connections |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when a manual certificate check as initiated with the |
|
This signal is emitted every time a certificate presented by a remote host needs to be checked manually. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Infinity.CertificateVerify(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Infinity.CertificateVerify
is an opaque data type. You should only access it via the public API functions.- classmethod new(xmpp_manager, known_hosts_file)¶
- Parameters:
xmpp_manager (
Infinity.XmppManager
) – TheInfinity.XmppManager
whoseInfinity.XmppConnection
s to manage the certificates for.known_hosts_file (
str
orNone
) – Path pointing to a file that contains certificates of known hosts, orNone
.
- Returns:
A new
Infinity.CertificateVerify
.- Return type:
Creates a new
Infinity.CertificateVerify
. For each new client-sideInfinity.XmppConnection
in xmpp_manager, the certificate manager will verify the server’s certificate.If the certificate is contained in known_hosts_file, or is issued by a trusted CA, then the certificate is accepted automatically. Otherwise, the
Infinity.CertificateVerify
::check-certificate
signal is emitted for a manual check of the certificate to be performed.
- checked(connection, result)¶
- Parameters:
connection (
Infinity.XmppConnection
) – TheInfinity.XmppConnection
whose certificate has been checked.result (
bool
) –True
if the certificate of connection should be accepted, orFalse
if it should be rejected.
This function should be called as a response to the
Infinity.CertificateVerify
::check-certificate
signal being emitted.
- do_check_cancelled(connection) virtual¶
- Parameters:
connection (
Infinity.XmppConnection
) –
- do_check_certificate(connection, certificate_chain, pinned_certificate, flags) virtual¶
- Parameters:
connection (
Infinity.XmppConnection
) –certificate_chain (
Infinity.CertificateChain
) –pinned_certificate (
InfGnutls.X509Crt
) –flags (
Infinity.CertificateVerifyFlags
) –
Signal Details¶
- Infinity.CertificateVerify.signals.check_cancelled(certificate_verify, connection)¶
- Signal Name:
check-cancelled
- Flags:
- Parameters:
certificate_verify (
Infinity.CertificateVerify
) – The object which received the signalconnection (
Infinity.XmppConnection
) – The connection to the remote host whose certificate is being verified.
This signal is emitted when a manual certificate check as initiated with the
Infinity.CertificateVerify
::check-certificate
signal should be cancelled. After this signal has been emitted,Infinity.CertificateVerify.checked
() should not be called anymore for the specified connection.This typically happens when the connection to the remote host is lost while the certificate check is in progress.
- Infinity.CertificateVerify.signals.check_certificate(certificate_verify, connection, certificate_chain, pinned_certificate, flags)¶
- Signal Name:
check-certificate
- Flags:
- Parameters:
certificate_verify (
Infinity.CertificateVerify
) – The object which received the signalconnection (
Infinity.XmppConnection
) – The connection to the remote host whose certificate is being verified.certificate_chain (
Infinity.CertificateChain
) – The certificate chain presented by the remote host.pinned_certificate (
object
orNone
) – The certificate that we have pinned for this host, orNone
.flags (
Infinity.CertificateVerifyFlags
) – Flags explaining why this certificate needs to be checked.
This signal is emitted every time a certificate presented by a remote host needs to be checked manually. This happens when the issuer of the certificate is not in the list of trusted CAs, or the certificate was issued for a different hostname than we expected. In this case, if the certificate is accepted manually, it will be pinned, so that next time a connection is made to the same host under the same hostname, the certificate is accepted automatically.
Consumers of this class should listen to this signal and call
Infinity.CertificateVerify.checked
() when they finished the manual certificate check.The pinned_certificate instance is valid until either
Infinity.CertificateVerify.checked
() is called or theInfinity.CertificateVerify
::check-cancelled
signal is emitted.
Property Details¶
- Infinity.CertificateVerify.props.known_hosts_file¶
-
File containing certificates of known hosts
- Infinity.CertificateVerify.props.xmpp_manager¶
- Name:
xmpp-manager
- Type:
- Default Value:
- Flags:
The XMPP manager of registered connections