mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): support TLS for unix sockets (#30169)
This commit adds initial support for connecting Unix socket over TLS in `node:tls.connect()` API --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit is contained in:
parent
56f2055c3f
commit
b05e8b20ac
7 changed files with 412 additions and 70 deletions
|
@ -41,6 +41,7 @@ import {
|
|||
newAsyncId,
|
||||
ownerSymbol,
|
||||
} from "ext:deno_node/internal/async_hooks.ts";
|
||||
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
|
||||
import {
|
||||
ERR_INVALID_ADDRESS_FAMILY,
|
||||
ERR_INVALID_ARG_TYPE,
|
||||
|
@ -380,7 +381,9 @@ function _afterConnect(
|
|||
|
||||
// Deno specific: run tls handshake if it's from a tls socket
|
||||
// This swaps the handle[kStreamBaseField] from TcpConn to TlsConn
|
||||
if (typeof handle.afterConnectTls === "function") {
|
||||
if (
|
||||
typeof handle.afterConnectTls === "function" && handle[kStreamBaseField]
|
||||
) {
|
||||
handle.afterConnectTls();
|
||||
}
|
||||
|
||||
|
@ -1287,7 +1290,6 @@ export class Socket extends Duplex {
|
|||
}
|
||||
|
||||
this.on("end", _onReadableStreamEnd);
|
||||
|
||||
_initSocketHandle(this);
|
||||
|
||||
// If we have a handle, then start the flow of data into the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue