Decided to take a short break from the work on QUIC
to implement a DTLS API. Very experimental at this
point but the basic API is there (inspired by the
QUIC API work).
The implementation is based on OpenSSL's built-in
DTLS support and no other dependencies are required.
DTLS is a datagram-based version of TLS that is used
for things like WebRTC and CoAP. It provides similar
security guarantees as TLS but is designed to work over
UDP instead of TCP.
This shouldn't be considered ready for production
but it is a good starting point for experimentation
and feedback.
```bash
./configure --experimental-dtls
make -j{nproc}
./node --experimental-dtls my-dtls-app.js
```
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode:Opus 4.6
PR-URL: https://github.com/nodejs/node/pull/63182
Fixes: https://github.com/nodejs/node/issues/61630
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
28 lines
860 B
JavaScript
28 lines
860 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
const actualKeys = new Set(Object.keys(process.features));
|
|
const expectedKeys = new Map([
|
|
['inspector', ['boolean']],
|
|
['debug', ['boolean']],
|
|
['uv', ['boolean']],
|
|
['ipv6', ['boolean']],
|
|
['openssl_is_boringssl', ['boolean']],
|
|
['dtls', ['boolean', 'undefined']],
|
|
['quic', ['boolean', 'undefined']],
|
|
['tls_alpn', ['boolean']],
|
|
['tls_sni', ['boolean']],
|
|
['tls_ocsp', ['boolean']],
|
|
['tls', ['boolean']],
|
|
['cached_builtins', ['boolean']],
|
|
['require_module', ['boolean']],
|
|
['typescript', ['boolean', 'string']],
|
|
]);
|
|
|
|
assert.deepStrictEqual(actualKeys, new Set(expectedKeys.keys()));
|
|
|
|
for (const [key, expected] of expectedKeys) {
|
|
assert.ok(expected.includes(typeof process.features[key]), `typeof process.features.${key} is not one of [${expected.join(', ')}]`);
|
|
}
|