Don't restart DTLS after receiving new tls-id while passive - #2157
Don't restart DTLS after receiving new tls-id while passive#2157alexbakker wants to merge 1 commit into
Conversation
When the remote end of a DTLS media session changes their ``tls-id`` in their answer in response to a re-INVITE, they are the one to initiate a new DTLS handshake. Previously, rtpengine would always perform a DTLS restart after seeing a new ``tls-id``, even if rtpengine's DTLS role is currently passive. This could abort an in-progress handshake, leaving the remote end retransmitting DTLS packets without ever getting a response. This patch addresses that.
|
Is that the correct behaviour though? Shouldn't we expect a new DTLS connection when the The RFC doesn't seem to describe that situation at all. |
|
That's my understanding based on RFC 8842 section 5.4:
And then section 3.1 states:
So, if we're passive and the remote and changes its |
|
|
The new handshake might already be in progress when the answer starts getting processed though. And like you said, a DTLS restart resets the existing DTLS connection context and thus wipes that state. That's the issue I encountered. |
|
Ok, but what if the existing DTLS context is fully established? So, say: initial offer/answer establishes DTLS. Re-invite offer comes in, same |
|
Hm, yes, you're right. Skipping DTLS restart in all cases is too broad. I suppose we need to check the state of the DTLS context to decide what to do. |
When the remote end of a DTLS media session changes their
tls-idin their answer in response to a re-INVITE, they are the one to initiate a new DTLS handshake. Previously, rtpengine would always perform a DTLS restart after seeing a newtls-id, even if rtpengine's DTLS role is currently passive. This could abort an in-progress handshake, leaving the remote end retransmitting DTLS packets without ever getting a response. This patch addresses that.