# RTCDtlsTransport

The DTLS transport that RTP and SCTP packets go over.

### *class* webrtc.interfaces.rtc_dtls_transport.RTCDtlsTransport(native_obj=None)

The DTLS transport that secures the packets of a [`webrtc.RTCPeerConnection`](rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection).

The RTP and RTCP packets of its senders and receivers, and the SCTP packets of its data channels, go over it.

See [MDN: RTCDtlsTransport](https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport).

* **Events:**
  * **statechange** ([`webrtc.Event`](../models/events.md#webrtc.models.events.Event)) – [`state`](#webrtc.interfaces.rtc_dtls_transport.RTCDtlsTransport.state) changed.
  * **error** ([`webrtc.RTCErrorEvent`](../models/events.md#webrtc.models.events.RTCErrorEvent)) – The transport failed. The event carries the
    [`webrtc.RTCError`](../exceptions.md#webrtc.exceptions.RTCError) that explains why.

### Events

- `statechange`: [`Event`](../models/events.md#webrtc.models.events.Event)
- `error`: [`RTCErrorEvent`](../models/events.md#webrtc.models.events.RTCErrorEvent)

Handlers are registered with [`on()`](../events.md#webrtc.utils.events.UniformEventTarget.on).

#### *property* ice_transport *: [RTCIceTransport](rtc_ice_transport.md#webrtc.interfaces.rtc_ice_transport.RTCIceTransport)*

The ICE transport the DTLS packets go over.

See [MDN: RTCDtlsTransport/iceTransport](https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport/iceTransport).

* **Type:**
  [`webrtc.RTCIceTransport`](rtc_ice_transport.md#webrtc.interfaces.rtc_ice_transport.RTCIceTransport)

#### *property* state *: [RTCDtlsTransportState](../enums.md#webrtc.enums.RTCDtlsTransportState)*

How far the DTLS handshake got, or whether it failed or closed.

See [MDN: RTCDtlsTransport/state](https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport/state).

* **Type:**
  [`webrtc.RTCDtlsTransportState`](../enums.md#webrtc.enums.RTCDtlsTransportState)

#### get_remote_certificates()

Returns the certificates the remote peer presented in the DTLS handshake, once it is done.

See [MDN: RTCDtlsTransport/getRemoteCertificates](https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport/getRemoteCertificates).

* **Returns:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes) – The DER-encoded certificates, with the peer’s own first. The list
  is empty before the handshake.
* **Return type:**
  [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[bytes](https://docs.python.org/3/builtins/stdtypes.html#bytes)]
