@ai-ecoverse/slicc-kernel 1.115.0 → 1.116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2542,7 +2542,7 @@ var KERNEL_VERSION, OS_RELEASE;
2542
2542
  var init_version = __esm({
2543
2543
  "src/version.ts"() {
2544
2544
  "use strict";
2545
- KERNEL_VERSION = true ? "1.115.0" : "0.0.0-dev";
2545
+ KERNEL_VERSION = true ? "1.116.0" : "0.0.0-dev";
2546
2546
  OS_RELEASE = "6.0.0-slicc";
2547
2547
  }
2548
2548
  });
@@ -15032,6 +15032,23 @@ function netOps(kernel, io) {
15032
15032
  }
15033
15033
  };
15034
15034
  };
15035
+ const tlsConnect = async (options, tls) => {
15036
+ const r = await kernel.json({
15037
+ op: "sock-tls",
15038
+ host: options.host ?? "localhost",
15039
+ port: port(options.port),
15040
+ ...tls.servername ? { servername: tls.servername } : {},
15041
+ ...tls.alpn ? { alpn: [...tls.alpn] } : {},
15042
+ ...tls.ca !== void 0 ? { ca: true } : {}
15043
+ });
15044
+ const session = Object.freeze({
15045
+ protocol: "transport",
15046
+ alpnProtocol: r.alpnProtocol,
15047
+ authorized: true,
15048
+ servername: r.servername
15049
+ });
15050
+ return Object.assign(await connection(r.fd), { tls: session });
15051
+ };
15035
15052
  const lookup2 = async (name3, options = {}) => {
15036
15053
  const family = options.family ?? 0;
15037
15054
  if (family !== 0 && family !== 4 && family !== 6) {
@@ -15062,6 +15079,7 @@ function netOps(kernel, io) {
15062
15079
  connect: async (options) => {
15063
15080
  const signal = options.signal ?? NEVER;
15064
15081
  signal.throwIfAborted();
15082
+ if (options.tls) return tlsConnect(options, options.tls);
15065
15083
  const host = options.host ?? "127.0.0.1";
15066
15084
  if (host.includes(":")) throw new JsCallError("EADDRNOTAVAIL", host);
15067
15085
  const addr = {