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>
116 lines
1.8 KiB
JavaScript
116 lines
1.8 KiB
JavaScript
import { createRequire } from 'module';
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const common = require('./index.js');
|
|
|
|
const {
|
|
allowGlobals,
|
|
buildType,
|
|
canCreateSymLink,
|
|
childShouldThrowAndAbort,
|
|
enoughTestMem,
|
|
escapePOSIXShell,
|
|
expectsError,
|
|
expectWarning,
|
|
getArrayBufferViews,
|
|
getBufferSources,
|
|
getTTYfd,
|
|
hasCrypto,
|
|
hasDtls,
|
|
hasQuic,
|
|
hasInspector,
|
|
hasSQLite,
|
|
hasFFI,
|
|
hasLocalStorage,
|
|
hasIntl,
|
|
hasTemporal,
|
|
hasIPv6,
|
|
isAIX,
|
|
isAlive,
|
|
isFreeBSD,
|
|
isIBMi,
|
|
isInsideDirWithUnusualChars,
|
|
isLinux,
|
|
isOpenBSD,
|
|
isMacOS,
|
|
isRiscv64,
|
|
isSunOS,
|
|
isWindows,
|
|
localIPv6Hosts,
|
|
mustCall,
|
|
mustCallAtLeast,
|
|
mustNotCall,
|
|
mustNotMutateObjectDeep,
|
|
mustSucceed,
|
|
nodeProcessAborted,
|
|
parseTestMetadata,
|
|
PIPE,
|
|
platformTimeout,
|
|
printSkipMessage,
|
|
runWithInvalidFD,
|
|
skip,
|
|
skipIf32Bits,
|
|
skipIfEslintMissing,
|
|
skipIfInspectorDisabled,
|
|
skipIfSQLiteMissing,
|
|
spawnPromisified,
|
|
sleepSync,
|
|
} = common;
|
|
|
|
const getPort = () => common.PORT;
|
|
|
|
export {
|
|
allowGlobals,
|
|
buildType,
|
|
canCreateSymLink,
|
|
childShouldThrowAndAbort,
|
|
createRequire,
|
|
enoughTestMem,
|
|
escapePOSIXShell,
|
|
expectsError,
|
|
expectWarning,
|
|
getArrayBufferViews,
|
|
getBufferSources,
|
|
getPort,
|
|
getTTYfd,
|
|
hasCrypto,
|
|
hasDtls,
|
|
hasQuic,
|
|
hasInspector,
|
|
hasSQLite,
|
|
hasFFI,
|
|
hasLocalStorage,
|
|
hasIntl,
|
|
hasTemporal,
|
|
hasIPv6,
|
|
isAIX,
|
|
isAlive,
|
|
isFreeBSD,
|
|
isIBMi,
|
|
isInsideDirWithUnusualChars,
|
|
isLinux,
|
|
isOpenBSD,
|
|
isMacOS,
|
|
isRiscv64,
|
|
isSunOS,
|
|
isWindows,
|
|
localIPv6Hosts,
|
|
mustCall,
|
|
mustCallAtLeast,
|
|
mustNotCall,
|
|
mustNotMutateObjectDeep,
|
|
mustSucceed,
|
|
nodeProcessAborted,
|
|
parseTestMetadata,
|
|
PIPE,
|
|
platformTimeout,
|
|
printSkipMessage,
|
|
runWithInvalidFD,
|
|
skip,
|
|
skipIf32Bits,
|
|
skipIfEslintMissing,
|
|
skipIfInspectorDisabled,
|
|
skipIfSQLiteMissing,
|
|
spawnPromisified,
|
|
sleepSync,
|
|
};
|