joyent/node — pull request #6704 by migounette (2013-12-14 13:34:38+00:00)
Title: DTLS - Draft approach

All,

This is a flush of the work done on DTLS support for node 0.11.x, this is not a stabilized version BUT I need comment how I modified the tls wrap, dgram and stream classes.

The goal was to keep the tls.cpp a maximum unchanged for the Datagram support and keep the Stream support unchanged.

Main changes philosophy
=======================
I tried to keep the maximum common code with TLS, DTLS is very close thanks to the OpenSSL
So, I extended Stream | TLSCallback | UDP in order to have an agnostic Callback wrapper (not stream colorized)
And I add an interface to needed function (Read | Write for Stream and Send | Receive for Datagram)

TODO
====================
A lot stuff to be done in order to insure that is fully functional
* Pass TSL tests (insure that there is no regression)
* Add DTLS tests in /tests sections
* Check DTLS algorithm used
* ...
* node.gyp (uncomment for js inclusion)

I will work on it in order to complete the work. But first I need feedback to insure that I am on the good tracks

How to test
=================
[Server]
set NODE_PATH=C:\node.dtls\lib
cd c:\node.dtls\tests
..\debug\node .\dtls-test.js

[Client]
With OpenSSL
Go to .\bin\PEM
..\openssl.exe s_client -connect localhost:8000 -dtls1

Then type any text and return, the server replies pong - {your text}