This PR resolves a number of smaller issues with DTLS support and adds a basic DTLS test, refactoring out common parts between the UDP and DTLS test cases.
The following issues were resolved:
Dropping a context that has an active DTLS session caused a panic because dropping the session would trigger the event handler, which could not obtain a reference to the context as it was not lent. To solve this, the event handler is now disabled when the context is dropped (I assume you wouldn't handle events in that case anyways).
The UseCurrent response for CoapServerCryptoProviders wasn't handled properly: The handler did not consider the correct key.
There is still one more issue that remains to be resolved: Currently, client-side sessions are kept in memory until the context is dropped, and not doing so causes some more crashes because the event handler is then called on a session that is in the process of being dropped. I'll look into that problem in the next few days.
Update: Is now fixed by temporarily disabling the event handler in the client side session drop implementation.
This PR resolves a number of smaller issues with DTLS support and adds a basic DTLS test, refactoring out common parts between the UDP and DTLS test cases.
The following issues were resolved:
UseCurrent
response for CoapServerCryptoProviders wasn't handled properly: The handler did not consider the correct key.There is still one more issue that remains to be resolved: Currently, client-side sessions are kept in memory until the context is dropped, and not doing so causes some more crashes because the event handler is then called on a session that is in the process of being dropped. I'll look into that problem in the next few days.Update: Is now fixed by temporarily disabling the event handler in the client side session drop implementation.