@ai-ecoverse/slicc-kernel 1.115.0 → 1.116.1

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.
@@ -5361,7 +5361,7 @@ var KERNEL_VERSION, OS_RELEASE;
5361
5361
  var init_version = __esm({
5362
5362
  "src/version.ts"() {
5363
5363
  "use strict";
5364
- KERNEL_VERSION = true ? "1.115.0" : "0.0.0-dev";
5364
+ KERNEL_VERSION = true ? "1.116.1" : "0.0.0-dev";
5365
5365
  OS_RELEASE = "6.0.0-slicc";
5366
5366
  }
5367
5367
  });
@@ -6949,6 +6949,23 @@ function netOps(kernel, io) {
6949
6949
  }
6950
6950
  };
6951
6951
  };
6952
+ const tlsConnect = async (options, tls) => {
6953
+ const r = await kernel.json({
6954
+ op: "sock-tls",
6955
+ host: options.host ?? "localhost",
6956
+ port: port(options.port),
6957
+ ...tls.servername ? { servername: tls.servername } : {},
6958
+ ...tls.alpn ? { alpn: [...tls.alpn] } : {},
6959
+ ...tls.ca !== void 0 ? { ca: true } : {}
6960
+ });
6961
+ const session = Object.freeze({
6962
+ protocol: "transport",
6963
+ alpnProtocol: r.alpnProtocol,
6964
+ authorized: true,
6965
+ servername: r.servername
6966
+ });
6967
+ return Object.assign(await connection(r.fd), { tls: session });
6968
+ };
6952
6969
  const lookup2 = async (name3, options = {}) => {
6953
6970
  const family = options.family ?? 0;
6954
6971
  if (family !== 0 && family !== 4 && family !== 6) {
@@ -6979,6 +6996,7 @@ function netOps(kernel, io) {
6979
6996
  connect: async (options) => {
6980
6997
  const signal = options.signal ?? NEVER;
6981
6998
  signal.throwIfAborted();
6999
+ if (options.tls) return tlsConnect(options, options.tls);
6982
7000
  const host = options.host ?? "127.0.0.1";
6983
7001
  if (host.includes(":")) throw new JsCallError("EADDRNOTAVAIL", host);
6984
7002
  const addr = {