PacketPeerDTLS
Inherits: PacketPeer < Reference < Object DTLS packet peer.
Description
DTLSServer.take_connection. 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.
Methods
Enumerations
Status:
- STATUS_DISCONNECTED = 0 —- A status representing a
PacketPeerDTLSthat is disconnected. - STATUS_HANDSHAKING = 1 —- A status representing a
PacketPeerDTLSthat is currently performing the handshake with a remote peer. - STATUS_CONNECTED = 2 —- A status representing a
PacketPeerDTLSthat is connected to a remote peer. - STATUS_ERROR = 3 —- A status representing a
PacketPeerDTLSin a generic error state. - 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.
Method Descriptions
- Error connect_to_peer ( PacketPeerUDP packet_peer, bool validate_certs=true, String for_hostname=””, X509Certificate valid_certificate=null )
peerbeginning the DTLS handshake using the underlying PacketPeerUDP which must be connected (see PacketPeerUDP.connect_to_host). Ifvalidate_certsistrue,PacketPeerDTLSwill validate that the certificate presented by the remote peer and match it with thefor_hostnameargument. You can specify a custom X509Certificate to use for validation via thevalid_certificateargument.
- disconnect_from_peer ( ) Disconnects this peer, terminating the DTLS session.
- Status get_status ( ) const Status for values.
- poll ( ) Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working.
