Fixes https://github.com/denoland/deno/issues/20594
This implements `JSStreamSocket` which drives the TLS underlying stream
in `rustls_tokio_stream` using 2 sets of channels. One for piping the
encrypted protocol transport and the other for plaintext application
data.
This fixes connecting to `npm:mssql`:
```js
import sql from "npm:mssql";
const sqlConfig = {
server: "localhost",
user: "divy",
password: "123",
database: "master",
options: {
trustServerCertificate: true,
},
};
const pool = await sql.connect(sqlConfig);
const result = await pool.request().query(`SELECT * FROM sys.databases`);
```
Fixes https://github.com/denoland/deno/issues/28903
Closes https://github.com/denoland/deno/issues/26190
- Adds a new option `unsafelyDisableHostnameVerification` to
`Deno.connectTls` and `Deno.startTls` to ignore DNS name mismatch errors
from rustls server verifier.
- Disable hostname verification in Node.js TLSSocket if
`checkServerIdentity` is a no-op.
---------
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Fixes https://github.com/denoland/deno/issues/28341
- handle `secureContext.key` and `secureContext.cert` in `new
TLSSocket()`
- Fix serialize when `secureContext.ca` is an array
Fixes MQTT connect support:
```
New connection from 127.0.0.1:58119 on port 8883.
1755367370: New client connected from 127.0.0.1:58119 as 637013c2-53c7-4779-9e84-50dcf2f2f81b (p5, c0, k60, u'test-client').
1755367370: No will message specified.
1755367370: Sending CONNACK to 637013c2-53c7-4779-9e84-50dcf2f2f81b (0, 0)
```