PacketPeerDTLS

    DTLS packet peer.

    This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by .

    Warning: SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period.

    enum Status:

    • STATUS_DISCONNECTED = 0 —- A status representing a that is disconnected.

    • STATUS_CONNECTED = 2 —- A status representing a PacketPeerDTLS that is connected to a remote peer.

    • STATUS_ERROR_HOSTNAME_MISMATCH = 4 —- An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation.

    • connect_to_peer ( PacketPeerUDP packet_peer, validate_certs=true, String for_hostname=””, valid_certificate=null )

    Connects a peer beginning the DTLS handshake using the underlying PacketPeerUDP which must be connected (see ). If validate_certs is , PacketPeerDTLS will validate that the certificate presented by the remote peer and match it with the for_hostname argument. You can specify a custom X509Certificate to use for validation via the argument.


    • void disconnect_from_peer ( )

    Disconnects this peer, terminating the DTLS session.


    Returns the status of the connection. See for values.


    • void poll ( )