Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536// node:tls, loadable and refusing: guest servers speak plain HTTP over the bridge and// there is no outbound network, so there is nothing to encrypt. Libraries that require// it at load time (ws does, for wss:// clients) still load.import { refused, refusedClass } from "./refuse";
const WHY = "there is no TLS: guest servers speak plain HTTP over the Service Worker bridge";
export const tls = { CLIENT_RENEG_LIMIT: 3, CLIENT_RENEG_WINDOW: 600, DEFAULT_CIPHERS: "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA", DEFAULT_ECDH_CURVE: "auto", DEFAULT_MAX_VERSION: "TLSv1.3", DEFAULT_MIN_VERSION: "TLSv1.2", connect: refused("tls", "connect", WHY), createServer: refused("tls", "createServer", WHY), createSecureContext: refused("tls", "createSecureContext", WHY), checkServerIdentity: refused("tls", "checkServerIdentity", WHY), TLSSocket: refusedClass("tls", "TLSSocket", WHY), Server: refusedClass("tls", "Server", WHY), SecureContext: refusedClass("tls", "SecureContext", WHY), convertALPNProtocols: refused("tls", "convertALPNProtocols", WHY), getCACertificates: refused("tls", "getCACertificates", WHY), getCiphers: refused("tls", "getCiphers", WHY), setDefaultCACertificates: refused("tls", "setDefaultCACertificates", WHY), // A throwing getter was tried first (truer to "refused, not faked"), but // src/kernel/transform.ts's ESM facade reads every named export eagerly // (`export const rootCertificates = m.rootCertificates;`) to build the module's // named exports, so a throw here breaks *any* `import ... from "node:tls"`, not // just code that reads this one property. A frozen empty array is less honest — // it claims zero trusted roots — but it's the only option that doesn't take the // whole module down; CommonJS's `require("tls").rootCertificates` has the same // value. See the report for this trade-off. rootCertificates: Object.freeze([]) as readonly string[],};