An undici dispatcher to enable TLS for given URLs
npm i undici-tls-dispatcher
const UndiciTLSDispatcher = require('undici-tls-dispatcher')
const dispatcher = new UndiciTLSDispatcher({
tlsConfig: [
{
url: 'https://yourserver.com',
tls: {
ca: '...'
cert: '...'
key: '...'
}
}
]
})
const res = await request(httpsServerUrl, { dispatcher })
...
See test.js
for a complete example.
Apache 2.0