on_ssl_server_authentication Event

Fires when connecting to the server.

Syntax

class DNSSSLServerAuthenticationEventParams(object):
  @property
  def remote_address() -> str: ...
  @property
  def remote_port() -> int: ...
  @property
  def cert_encoded() -> bytes: ...
  @property
  def cert_subject() -> str: ...
  @property
  def cert_issuer() -> str: ...
  @property
  def status() -> str: ...
  @property
  def accept() -> bool: ...
  @accept.setter
  def accept(value) -> None: ...

# In class DNS:
@property
def on_ssl_server_authentication() -> Callable[[DNSSSLServerAuthenticationEventParams], None]: ...
@on_ssl_server_authentication.setter
def on_ssl_server_authentication(event_hook: Callable[[DNSSSLServerAuthenticationEventParams], None]) -> None: ...

Remarks

This event is where the client can decide whether to continue with the connection process or not. The Accept parameter is a recommendation on whether to continue or close the connection. This is just a suggestion: application software must use its own logic to determine whether to continue or not.

When Accept is False, Status shows why the verification failed (otherwise, Status contains the string "OK"). If it is decided to continue, you can override and accept the certificate by setting the Accept parameter to True.

RemoteAddress is the IP address of the server.

RemotePort is the source port of the server.

CertEncoded is the base64 encoded certificate presented by the server.

CertSubject is the subject of the certificate presented by the server.

CertIssuer is the subject of the issuer of the certificate presented by the server.

Status is the stauts of the certificate.

Accept defines whether the certificate is accepted.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]