Closed nickdesaulniers closed 8 years ago
It's one of the missing bits mentioned in the README.md. I don't remember how the specification defines the 'alert' messages - whether they are protocol level errors that should be handled within the socket or whether they should be handled in user code.
I guess a simple addition would be to emit them as 'error' events similar to how the applicationData is emitted as 'message' events. But this would then leave the responsibility of reacting to them to the user code.
Can you give an example of an alert you're receiving?
{ type: 21,
version: { major: -2, minor: -3 },
epoch: 0,
sequenceNumber: <Buffer 00 00 00 00 00 03>,
fragment: <Buffer 02 28> }
so it sounds like you're spec compliant from reading that section.
it looks like "alert" is a type of message: https://github.com/Rantanen/node-dtls/blob/e7410c20d839fe95dfa76552f932bea05ad8f8b8/dtls.js#L8
for which there is no handler assigned: https://github.com/Rantanen/node-dtls/blob/e7410c20d839fe95dfa76552f932bea05ad8f8b8/DtlsSocket.js#L124-L134
are consumers of this lib expected to assign one?