aiortc / aioice

asyncio-based Interactive Connectivity Establishment (RFC 5245)
BSD 3-Clause "New" or "Revised" License
105 stars 51 forks source link

Stale Nonce #28

Closed buendiya closed 3 years ago

buendiya commented 4 years ago

Hi According to https://tools.ietf.org/html/rfc5389#page-27.

If the response is an error response with an error code of 438 (Stale Nonce), the client MUST retry the request, using the new NONCE supplied in the 438 (Stale Nonce) response.

I can't find implementation about this in code.

I am using coturn as turnserver. The default nonce lifetime is 600 secs. It will raise a Stale Nonce TransactionFailed after 600 secs.

jlaine commented 3 years ago

Is there a public server where I can test this?

jlaine commented 3 years ago

From reading the RFC I'm not sure I can tell the difference between the handling of 401 or 438 status codes. It seems in both cases the NONCE and REALM attributes need to be updated?

I am tempted to handle both cases here:

https://github.com/aiortc/aioice/blob/main/src/aioice/turn.py#L87