@cosyte/mllp 0.1.11 → 0.1.13

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.
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { createSecureContext, createServer as createServer$2, connect, checkServ
2
2
  import { EventEmitter } from 'events';
3
3
  import { randomUUID } from 'crypto';
4
4
  import { createServer as createServer$1, createConnection, isIP, SocketAddress } from 'net';
5
+ import { types } from 'util';
5
6
 
6
7
  // src/framing/registry.ts
7
8
  function createWarning(code, byteOffset, message) {
@@ -644,13 +645,23 @@ var MLLP_BIND_ALL_INTERFACES = "MLLP_BIND_ALL_INTERFACES";
644
645
  var MLLP_TLS_CIPHER_LIST_REJECTED = "MLLP_TLS_CIPHER_LIST_REJECTED";
645
646
  var MLLP_TLS_CIPHER_OPTION_CONFLICT = "MLLP_TLS_CIPHER_OPTION_CONFLICT";
646
647
  var MLLP_TLS_DH_PARAMETERS_REJECTED = "MLLP_TLS_DH_PARAMETERS_REJECTED";
647
- var TLS_CONFIGURATION_MESSAGES = Object.freeze({
648
- [MLLP_TLS_CIPHER_LIST_REJECTED]: "the TLS library rejected the configured cipher-suite list; no connection was opened and no fallback to the runtime default list was made",
649
- [MLLP_TLS_CIPHER_OPTION_CONFLICT]: "tls.atnaTransportSecurity and tls.ciphers both declare the offered cipher-suite list; set exactly one of them",
650
- [MLLP_TLS_DH_PARAMETERS_REJECTED]: "the configured ephemeral Diffie-Hellman parameters are not usable; nothing was bound and no fallback to a server without Diffie-Hellman parameters was made"
651
- });
648
+ var MLLP_TLS_CIPHER_LIST_UNENFORCEABLE = "MLLP_TLS_CIPHER_LIST_UNENFORCEABLE";
649
+ var MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE = "MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE";
650
+ var MLLP_TLS_PFX_REJECTED = "MLLP_TLS_PFX_REJECTED";
651
+ var MLLP_TLS_CREDENTIAL_CONFLICT = "MLLP_TLS_CREDENTIAL_CONFLICT";
652
+ var MLLP_TLS_OPTIONS_NOT_AN_OBJECT = "MLLP_TLS_OPTIONS_NOT_AN_OBJECT";
652
653
  function tlsConfigurationMessage(code) {
653
- return TLS_CONFIGURATION_MESSAGES[code];
654
+ const messages = {
655
+ [MLLP_TLS_CIPHER_LIST_REJECTED]: "the TLS library rejected the configured cipher-suite list; no connection was opened and no fallback to the runtime default list was made",
656
+ [MLLP_TLS_CIPHER_OPTION_CONFLICT]: "tls.atnaTransportSecurity and tls.ciphers both declare the offered cipher-suite list; set exactly one of them",
657
+ [MLLP_TLS_DH_PARAMETERS_REJECTED]: "the configured ephemeral Diffie-Hellman parameters are not usable; nothing was bound and no fallback to a server without Diffie-Hellman parameters was made",
658
+ [MLLP_TLS_CIPHER_LIST_UNENFORCEABLE]: "this runtime's TLS library does not enforce a configured cipher-suite list; no connection was opened, rather than one offering a list other than the one configured",
659
+ [MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE]: "this runtime's TLS library does not enforce server Diffie-Hellman parameters; nothing was bound, rather than a server running without the parameters configured",
660
+ [MLLP_TLS_PFX_REJECTED]: "tls.pfx could not be loaded with tls.passphrase: the passphrase is wrong, the file is not PKCS#12, or it uses a legacy encryption (RC2-40, as `openssl pkcs12 -export -legacy` and older exports write it) that OpenSSL 3 does not load, so re-export it with AES-256; no socket was opened",
661
+ [MLLP_TLS_CREDENTIAL_CONFLICT]: "tls.pfx was set together with tls.cert or tls.key; the PKCS#12 file carries its own certificate and key, so set either cert and key or pfx, not both",
662
+ [MLLP_TLS_OPTIONS_NOT_AN_OBJECT]: "tls must be an object of TLS options, or true for a client's defaults; it was null, an array, another kind of object or a value that is no object, and no client or server was created"
663
+ };
664
+ return messages[code];
654
665
  }
655
666
  var MllpTlsConfigurationError = class _MllpTlsConfigurationError extends Error {
656
667
  name = "MllpTlsConfigurationError";
@@ -660,7 +671,8 @@ var MllpTlsConfigurationError = class _MllpTlsConfigurationError extends Error {
660
671
  */
661
672
  code;
662
673
  /**
663
- * The TLS library's own error, when the runtime is what refused the list.
674
+ * The TLS library's own error, when the runtime is what refused the input
675
+ * (or, for an `_UNENFORCEABLE` code, refused one of the probes).
664
676
  * `undefined` when this package refused the configuration itself.
665
677
  */
666
678
  cause;
@@ -824,6 +836,47 @@ var ATNA_CIPHER_LIST = [
824
836
  ...TLS13_DEFAULT_CIPHER_SUITES,
825
837
  ...ATNA_CIPHER_SUITES
826
838
  ].join(":");
839
+ function refusalOf(options) {
840
+ try {
841
+ createSecureContext(options);
842
+ } catch (err) {
843
+ return err instanceof Error ? err : new Error(String(err));
844
+ }
845
+ return null;
846
+ }
847
+ var probeResults = /* @__PURE__ */ new Map();
848
+ function probeRefusal(probe) {
849
+ const key = "ciphers" in probe ? `ciphers=${probe.ciphers}` : `dhparam=${probe.dhparam}`;
850
+ const found = probeResults.get(key);
851
+ if (found !== void 0) return found;
852
+ const refusal = refusalOf(probe);
853
+ probeResults.set(key, refusal);
854
+ return refusal;
855
+ }
856
+ function assertCipherListEnforced(atna) {
857
+ if (probeRefusal({ ciphers: "ECDHE-RSA-AES128-GCM-SHA256:!ECDHE-RSA-AES128-GCM-SHA256" }) === null) {
858
+ throw new MllpTlsConfigurationError(MLLP_TLS_CIPHER_LIST_UNENFORCEABLE);
859
+ }
860
+ if (!atna) return;
861
+ for (const suite of ATNA_CIPHER_SUITES) {
862
+ const refusal = probeRefusal({ ciphers: suite });
863
+ if (refusal !== null) {
864
+ throw new MllpTlsConfigurationError(MLLP_TLS_CIPHER_LIST_UNENFORCEABLE, { cause: refusal });
865
+ }
866
+ }
867
+ }
868
+ function assertDhParametersEnforced() {
869
+ const autoRefusal = probeRefusal({ dhparam: "auto" });
870
+ if (autoRefusal !== null) {
871
+ throw new MllpTlsConfigurationError(MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE, {
872
+ cause: autoRefusal
873
+ });
874
+ }
875
+ const undersized = "-----BEGIN DH PARAMETERS-----\nMAYCARcCAQU=\n-----END DH PARAMETERS-----\n";
876
+ if (probeRefusal({ dhparam: undersized }) === null) {
877
+ throw new MllpTlsConfigurationError(MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE);
878
+ }
879
+ }
827
880
  function assertUsableDhParameters(dhParameters) {
828
881
  if (!isDhParametersPem(dhParameters)) {
829
882
  throw new MllpTlsConfigurationError(MLLP_TLS_DH_PARAMETERS_REJECTED);
@@ -848,7 +901,9 @@ function resolveTlsCipherPolicy(opts, side) {
848
901
  const supplied = side === "server" ? opts.dhParameters : void 0;
849
902
  if (supplied !== void 0) assertUsableDhParameters(supplied);
850
903
  const dhparam = supplied ?? (atna && side === "server" ? "auto" : void 0);
904
+ if (dhparam !== void 0) assertDhParametersEnforced();
851
905
  if (ciphers !== void 0) {
906
+ assertCipherListEnforced(atna);
852
907
  try {
853
908
  createSecureContext({ ciphers });
854
909
  } catch (err) {
@@ -872,14 +927,23 @@ function readNegotiatedTlsParameters(socket, host, port) {
872
927
  const cipher = socket.getCipher();
873
928
  const cipherSuite = cipher.standardName === "" ? cipher.name : cipher.standardName;
874
929
  if (cipherSuite === "") return null;
930
+ const keyExchangeGroup = readKeyExchangeGroup(socket);
875
931
  return Object.freeze({
876
932
  protocolVersion,
877
933
  cipherSuite,
934
+ ...keyExchangeGroup === void 0 ? {} : { keyExchangeGroup },
878
935
  host,
879
936
  port,
880
937
  timestamp: /* @__PURE__ */ new Date()
881
938
  });
882
939
  }
940
+ function readKeyExchangeGroup(socket) {
941
+ if (typeof socket.getEphemeralKeyInfo !== "function") return void 0;
942
+ const info = socket.getEphemeralKeyInfo();
943
+ if (typeof info !== "object" || info === null || !("name" in info)) return void 0;
944
+ const { name } = info;
945
+ return typeof name === "string" && name !== "" ? name : void 0;
946
+ }
883
947
 
884
948
  // src/connection/error.ts
885
949
  var MllpConnectionError = class _MllpConnectionError extends Error {
@@ -1371,6 +1435,65 @@ var Connection = class extends EventEmitter {
1371
1435
  });
1372
1436
  }
1373
1437
  };
1438
+ function checkCredentialMix(tls) {
1439
+ if (typeof tls !== "object" || tls.pfx === void 0) return;
1440
+ if (tls.cert !== void 0 || tls.key !== void 0) {
1441
+ throw new MllpTlsConfigurationError(MLLP_TLS_CREDENTIAL_CONFLICT);
1442
+ }
1443
+ }
1444
+ function pfxRefusal(pfx, passphrase) {
1445
+ if (pfx === void 0) return void 0;
1446
+ try {
1447
+ createSecureContext({ pfx, passphrase });
1448
+ return void 0;
1449
+ } catch (err) {
1450
+ return new MllpTlsConfigurationError(MLLP_TLS_PFX_REJECTED, { cause: err });
1451
+ }
1452
+ }
1453
+ function checkPfx(pfx, passphrase) {
1454
+ const refusal = pfxRefusal(pfx, passphrase);
1455
+ if (refusal !== void 0) throw refusal;
1456
+ }
1457
+ function tlsOptionNames() {
1458
+ const names = {
1459
+ ca: "ca",
1460
+ cert: "cert",
1461
+ key: "key",
1462
+ passphrase: "passphrase",
1463
+ pfx: "pfx",
1464
+ servername: "servername",
1465
+ minVersion: "minVersion",
1466
+ maxVersion: "maxVersion",
1467
+ atnaTransportSecurity: "atnaTransportSecurity",
1468
+ ciphers: "ciphers",
1469
+ allowUnverified: "allowUnverified",
1470
+ clientAuth: "clientAuth",
1471
+ dhParameters: "dhParameters"
1472
+ };
1473
+ return Object.values(names);
1474
+ }
1475
+ function copyValue(value) {
1476
+ return ArrayBuffer.isView(value) ? Buffer.from(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)) : value;
1477
+ }
1478
+ function isOptionsObject(value) {
1479
+ if (typeof value !== "object" || value === null) return false;
1480
+ return !(Array.isArray(value) || ArrayBuffer.isView(value) || types.isAnyArrayBuffer(value) || types.isMap(value) || types.isSet(value) || types.isDate(value) || types.isPromise(value) || types.isBoxedPrimitive(value));
1481
+ }
1482
+ function copyTlsOptions(tls) {
1483
+ if (tls === void 0 || tls === true) return tls;
1484
+ const given = tls;
1485
+ if (!isOptionsObject(given)) {
1486
+ throw new MllpTlsConfigurationError(MLLP_TLS_OPTIONS_NOT_AN_OBJECT);
1487
+ }
1488
+ const source = given;
1489
+ const copy = {};
1490
+ for (const name of tlsOptionNames()) {
1491
+ const value = source[name];
1492
+ if (value === void 0) continue;
1493
+ copy[name] = Array.isArray(value) ? value.map(copyValue) : copyValue(value);
1494
+ }
1495
+ return copy;
1496
+ }
1374
1497
 
1375
1498
  // src/internal/control-id.ts
1376
1499
  var ASCII_M = 77;
@@ -1609,6 +1732,9 @@ function trimSpaces(value) {
1609
1732
  while (end > start && value.charAt(end - 1) === SPACE) end--;
1610
1733
  return value.substring(start, end);
1611
1734
  }
1735
+ function readConditionField(raw, delimiters) {
1736
+ return readTableField(raw, delimiters, TABLE_0155);
1737
+ }
1612
1738
  function readTableField(raw, delimiters, table) {
1613
1739
  if (raw === void 0) return { kind: "null", byteLength: 0 };
1614
1740
  const byteLength = raw.length;
@@ -1754,6 +1880,8 @@ var MllpServer = class extends EventEmitter {
1754
1880
  _netServer;
1755
1881
  _connections = /* @__PURE__ */ new Set();
1756
1882
  _opts;
1883
+ /** The TLS options as they were at construction; never read `_opts.tls`, which the caller owns. */
1884
+ _tls;
1757
1885
  /** `true` when `ServerOptions.tls` is set, `_netServer` is actually a `tls.Server`. */
1758
1886
  _isTls;
1759
1887
  _listening = false;
@@ -1770,6 +1898,18 @@ var MllpServer = class extends EventEmitter {
1770
1898
  _host = null;
1771
1899
  _acceptedTotal = 0;
1772
1900
  _closedTotal = 0;
1901
+ /**
1902
+ * Sockets accepted and not yet closed, counted only when {@link ServerOptions.maxConnections} is
1903
+ * set: the number the cap is compared against.
1904
+ */
1905
+ _openSockets = 0;
1906
+ /** Sockets the connection cap closed at accept, so a runtime's report of them is recognised. */
1907
+ _closedAtAccept = /* @__PURE__ */ new WeakSet();
1908
+ /**
1909
+ * For each socket the connection cap counted, what gives its place back. Released once, however
1910
+ * many times it is called.
1911
+ */
1912
+ _capRelease = /* @__PURE__ */ new WeakMap();
1773
1913
  /** Count of `'tlsClientError'` events since listen(). */
1774
1914
  _tlsClientErrorsTotal = 0;
1775
1915
  /**
@@ -1796,25 +1936,38 @@ var MllpServer = class extends EventEmitter {
1796
1936
  "ServerOptions.maxConnections must be a positive integer, or left unset for no cap"
1797
1937
  );
1798
1938
  }
1939
+ const tlsInput = copyTlsOptions(opts.tls);
1940
+ checkCredentialMix(tlsInput);
1941
+ if (tlsInput !== void 0 && tlsInput.pfx === void 0 && (tlsInput.cert === void 0 || tlsInput.key === void 0)) {
1942
+ throw new TypeError("ServerOptions.tls needs cert and key, or pfx");
1943
+ }
1799
1944
  this._opts = opts;
1800
- this._isTls = opts.tls !== void 0;
1945
+ this._tls = tlsInput;
1946
+ this._isTls = tlsInput !== void 0;
1801
1947
  let cipherPolicy = null;
1802
- if (opts.tls !== void 0) {
1948
+ if (tlsInput !== void 0) {
1803
1949
  try {
1804
- cipherPolicy = resolveTlsCipherPolicy(opts.tls, "server");
1950
+ checkPfx(tlsInput.pfx, tlsInput.passphrase);
1951
+ cipherPolicy = resolveTlsCipherPolicy(tlsInput, "server");
1805
1952
  } catch (err) {
1806
1953
  if (!(err instanceof MllpTlsConfigurationError)) throw err;
1807
1954
  this._tlsConfigError = err;
1808
1955
  }
1809
1956
  }
1810
- if (opts.tls !== void 0 && cipherPolicy === null) {
1957
+ if (tlsInput === void 0) {
1811
1958
  this._netServer = createServer$1();
1812
- } else if (opts.tls !== void 0 && cipherPolicy !== null) {
1813
- const tlsOpts = opts.tls;
1959
+ this._netServer.on("connection", (socket) => {
1960
+ this._onSocketAccepted(socket);
1961
+ });
1962
+ } else if (cipherPolicy === null) {
1963
+ this._netServer = createServer$1();
1964
+ } else {
1965
+ const tlsOpts = tlsInput;
1814
1966
  const clientAuth = tlsOpts.clientAuth ?? "NONE";
1815
1967
  const tlsServer = createServer$2({
1816
1968
  cert: tlsOpts.cert,
1817
1969
  key: tlsOpts.key,
1970
+ pfx: tlsOpts.pfx,
1818
1971
  ...tlsOpts.ca !== void 0 ? { ca: tlsOpts.ca } : {},
1819
1972
  ...tlsOpts.passphrase !== void 0 ? { passphrase: tlsOpts.passphrase } : {},
1820
1973
  minVersion: tlsOpts.minVersion ?? "TLSv1.2",
@@ -1828,6 +1981,7 @@ var MllpServer = class extends EventEmitter {
1828
1981
  this._onSocketAccepted(socket);
1829
1982
  });
1830
1983
  tlsServer.on("tlsClientError", (err, socket) => {
1984
+ if (this._closedAtAccept.has(socket)) return;
1831
1985
  this._tlsClientErrorsTotal += 1;
1832
1986
  const nodeErr = err;
1833
1987
  const event = Object.freeze({
@@ -1839,11 +1993,6 @@ var MllpServer = class extends EventEmitter {
1839
1993
  });
1840
1994
  this._emitContained("tlsClientError", event);
1841
1995
  });
1842
- } else {
1843
- this._netServer = createServer$1();
1844
- this._netServer.on("connection", (socket) => {
1845
- this._onSocketAccepted(socket);
1846
- });
1847
1996
  }
1848
1997
  this._netServer.on("error", (err) => {
1849
1998
  if (this.listenerCount("error") > 0) {
@@ -1852,26 +2001,67 @@ var MllpServer = class extends EventEmitter {
1852
2001
  this.emit("error", err);
1853
2002
  }
1854
2003
  });
1855
- if (maxConnections !== void 0) {
1856
- this._netServer.maxConnections = maxConnections;
1857
- this._netServer.on("drop", (data) => {
1858
- this._onConnectionOverCap(maxConnections, data);
1859
- });
1860
- }
2004
+ if (maxConnections !== void 0) this._gateConnections(maxConnections);
2005
+ }
2006
+ /**
2007
+ * Enforce {@link ServerOptions.maxConnections} by counting sockets here, at accept.
2008
+ *
2009
+ * WHY NOT THE LISTENER'S OWN `maxConnections`. Node's `net.Server` enforces a cap of its own and
2010
+ * reports each refusal on `'drop'`, but that report is the runtime's to make, and Deno's
2011
+ * `node:net` closes the socket without emitting `'drop'` (measured: Deno 2.9.8), so the cap held
2012
+ * and `'connectionRejected'` never fired. Counting here makes the cap and its event a property of
2013
+ * this package on every runtime.
2014
+ *
2015
+ * The gate sits IN FRONT of every `'connection'` listener the server already has, and replaces
2016
+ * them: for a plaintext server that is this class's own accept handler, and for a TLS server it
2017
+ * is the runtime's, which wraps the raw socket and starts the handshake. An over-cap socket is
2018
+ * destroyed before either runs, so it never becomes a `Connection`, costs no handshake, and is
2019
+ * not a `'tlsClientError'`. The count is of open sockets, the number that bounds file
2020
+ * descriptors: a socket counts from accept until its `'close'`, handshake in flight included.
2021
+ *
2022
+ * @param maxConnections - The validated cap.
2023
+ */
2024
+ _gateConnections(maxConnections) {
2025
+ const server = this._netServer;
2026
+ const downstream = server.listeners("connection");
2027
+ server.removeAllListeners("connection");
2028
+ server.on("connection", (socket) => {
2029
+ if (this._openSockets >= maxConnections) {
2030
+ const remoteAddress = socket.remoteAddress ?? null;
2031
+ const remotePort = socket.remotePort ?? null;
2032
+ this._closedAtAccept.add(socket);
2033
+ socket.destroy();
2034
+ this._onConnectionOverCap(maxConnections, remoteAddress, remotePort);
2035
+ return;
2036
+ }
2037
+ this._openSockets += 1;
2038
+ let released = false;
2039
+ const release = () => {
2040
+ if (released) return;
2041
+ released = true;
2042
+ this._openSockets -= 1;
2043
+ };
2044
+ this._capRelease.set(socket, release);
2045
+ try {
2046
+ for (const listener of downstream) listener.call(server, socket);
2047
+ } finally {
2048
+ socket.once("close", release);
2049
+ }
2050
+ });
1861
2051
  }
1862
2052
  /**
1863
- * Report a connection the listener closed at accept because the cap was full.
2053
+ * Report a connection closed at accept because the cap was full.
1864
2054
  *
1865
- * Contained: this runs inside the listener's own 'drop' callback, so a throwing subscriber would
1866
- * otherwise unwind into the accept path. The throw is surfaced on 'error' instead.
2055
+ * Contained: this runs inside the listener's own 'connection' callback, so a throwing subscriber
2056
+ * would otherwise unwind into the accept path. The throw is surfaced on 'error' instead.
1867
2057
  */
1868
- _onConnectionOverCap(maxConnections, data) {
2058
+ _onConnectionOverCap(maxConnections, remoteAddress, remotePort) {
1869
2059
  const event = Object.freeze({
1870
2060
  code: MLLP_CONNECTION_LIMIT_REACHED,
1871
2061
  message: CONNECTION_LIMIT_MESSAGE,
1872
2062
  maxConnections,
1873
- remoteAddress: data?.remoteAddress ?? null,
1874
- remotePort: data?.remotePort ?? null,
2063
+ remoteAddress,
2064
+ remotePort,
1875
2065
  timestamp: /* @__PURE__ */ new Date()
1876
2066
  });
1877
2067
  this._emitContained("connectionRejected", event);
@@ -2241,6 +2431,7 @@ var MllpServer = class extends EventEmitter {
2241
2431
  if (this._opts.keepaliveIntervalMs !== void 0) {
2242
2432
  socket.setKeepAlive(true, this._opts.keepaliveIntervalMs);
2243
2433
  }
2434
+ socket.setNoDelay(this._opts.noDelay !== false);
2244
2435
  const transport = this._isTls ? new TlsTransport(socket) : new NetTransport(socket);
2245
2436
  const mergedFraming = {
2246
2437
  ...SERVER_DEFAULT_FRAMING,
@@ -2248,6 +2439,8 @@ var MllpServer = class extends EventEmitter {
2248
2439
  };
2249
2440
  const connOpts = this._opts.onWarning !== void 0 ? { transport, framing: mergedFraming, onWarning: this._opts.onWarning } : { transport, framing: mergedFraming };
2250
2441
  const conn = new Connection(connOpts);
2442
+ const release = this._capRelease.get(socket);
2443
+ if (release !== void 0) socket.once("close", release);
2251
2444
  conn.beforeClose = () => Promise.resolve();
2252
2445
  conn.on("error", (errEvent) => {
2253
2446
  this._emitErrorIfListened(errEvent);
@@ -2311,7 +2504,7 @@ var MllpServer = class extends EventEmitter {
2311
2504
  }
2312
2505
  }
2313
2506
  );
2314
- const peerCertificate = this._isTls && (this._opts.tls?.clientAuth ?? "NONE") !== "NONE" ? this._extractPeerCertificateSummary(socket) : null;
2507
+ const peerCertificate = (this._tls?.clientAuth ?? "NONE") !== "NONE" ? this._extractPeerCertificateSummary(socket) : null;
2315
2508
  this._emitContained(
2316
2509
  "connection",
2317
2510
  Object.freeze({
@@ -2587,6 +2780,24 @@ async function createStarterServer(opts) {
2587
2780
  return server;
2588
2781
  }
2589
2782
 
2783
+ // src/server/ack-code.ts
2784
+ function selectAckCode(input) {
2785
+ const { outcome } = input;
2786
+ if (outcome !== "AA" && outcome !== "AE" && outcome !== "AR") {
2787
+ throw new RangeError("selectAckCode: outcome must be one of AA, AE or AR");
2788
+ }
2789
+ const delimiters = delimitersFrom(input.encodingCharacters ?? "^~\\&");
2790
+ const accept = readConditionField(input.msh15, delimiters);
2791
+ const application = readConditionField(input.msh16, delimiters);
2792
+ return Object.freeze({
2793
+ code: acceptAckRequested(accept, outcome) ? acceptModeCounterpart(outcome) : outcome,
2794
+ mode: accept.kind === "null" && application.kind === "null" ? "original" : "enhanced",
2795
+ applicationAckRequested: application.kind !== "code" || acceptAckRequested(application, outcome),
2796
+ acceptTypeUnrecognised: accept.kind === "unrecognised",
2797
+ applicationTypeUnrecognised: application.kind === "unrecognised"
2798
+ });
2799
+ }
2800
+
2590
2801
  // src/client/correlator.ts
2591
2802
  var Correlator = class {
2592
2803
  _opts;
@@ -2656,8 +2867,11 @@ var Correlator = class {
2656
2867
  * `twoPhase` is the enhanced-mode state for a send being correlated by control ID.
2657
2868
  * Omitting it (or passing `null`) is what every other send does, and such an entry is
2658
2869
  * settled by the first acknowledgement matched to it, exactly as before.
2870
+ *
2871
+ * `ackTimeoutMs` is this send's own bound on the wait for its acknowledgement. Omitting it
2872
+ * gives the entry the correlator-wide `ackTimeoutMs`.
2659
2873
  */
2660
- enqueue(frame, controlIdOrNull, resolve, reject, twoPhase = null) {
2874
+ enqueue(frame, controlIdOrNull, resolve, reject, twoPhase = null, ackTimeoutMs) {
2661
2875
  if (this._pending.size >= this._opts.maxInFlight) return null;
2662
2876
  const key = this._opts.mode === "controlId" ? controlIdOrNull ?? `__seq-${++this._sendSeq}` : ++this._sendSeq;
2663
2877
  const entry = {
@@ -2666,6 +2880,7 @@ var Correlator = class {
2666
2880
  controlId: controlIdOrNull,
2667
2881
  byteCount: frame.length,
2668
2882
  sentAt: null,
2883
+ ackTimeoutMs: ackTimeoutMs ?? this._opts.ackTimeoutMs,
2669
2884
  resolve,
2670
2885
  reject,
2671
2886
  twoPhase
@@ -2842,7 +3057,7 @@ var Correlator = class {
2842
3057
  return null;
2843
3058
  }
2844
3059
  /**
2845
- * Sweep live entries; expire those past `sentAt + ackTimeoutMs`.
3060
+ * Sweep live entries; expire those past `sentAt` plus their own `ackTimeoutMs`.
2846
3061
  * Fires `onTimeout(entry, elapsedMs)`; entries move to graveyard.
2847
3062
  * Driven externally by `MllpClient`'s periodic sweep tick, Correlator
2848
3063
  * itself owns no timers.
@@ -2854,7 +3069,6 @@ var Correlator = class {
2854
3069
  */
2855
3070
  expireDue(now) {
2856
3071
  const t = now ?? this._opts.now();
2857
- const ackTimeoutMs = this._opts.ackTimeoutMs;
2858
3072
  for (const [key, entry] of this._pending) {
2859
3073
  if (entry.sentAt === null) continue;
2860
3074
  const twoPhase = entry.twoPhase;
@@ -2872,7 +3086,7 @@ var Correlator = class {
2872
3086
  }
2873
3087
  continue;
2874
3088
  }
2875
- if (entry.sentAt + ackTimeoutMs <= t) {
3089
+ if (entry.sentAt + entry.ackTimeoutMs <= t) {
2876
3090
  const elapsed = t - entry.sentAt;
2877
3091
  this._removeExpired(key, entry);
2878
3092
  if (twoPhase !== null) {
@@ -3255,6 +3469,10 @@ function identityOptions(host, servername) {
3255
3469
  }
3256
3470
  var MllpClient = class extends EventEmitter {
3257
3471
  _opts;
3472
+ /** The TLS options as they were at construction; never read `_opts.tls`, which the caller owns. */
3473
+ _tls;
3474
+ /** Why `tls.pfx` cannot be loaded, found once at construction; `undefined` when it loads or is unset. */
3475
+ _pfxRefusal;
3258
3476
  _connection = null;
3259
3477
  _socket = null;
3260
3478
  /**
@@ -3319,6 +3537,15 @@ var MllpClient = class extends EventEmitter {
3319
3537
  _connectSignal;
3320
3538
  /** Set when close()/destroy()/abort fires; reconnect handler short-circuits. */
3321
3539
  _userClosed = false;
3540
+ /**
3541
+ * The reason passed to the `destroy(reason)` that closed a connection still connecting, `null`
3542
+ * otherwise. The socket hands it back on `'error'`, and `connect()` compares by identity so the
3543
+ * caller's own reason is carried as the cause and never sorted into a TLS `connectionCause`.
3544
+ * Only the call that reaches the socket records it: a later `destroy()` finds the connection
3545
+ * already CLOSED and leaves it alone. Cleared once matched and at the start of `connect()`, so
3546
+ * the client does not keep the caller's object alive.
3547
+ */
3548
+ _destroyReason = null;
3322
3549
  /**
3323
3550
  * Sends parked inside the client with nothing written for them. See {@link ParkedSend}.
3324
3551
  * Every entry removes itself the moment its own wait ends, however it ends.
@@ -3381,6 +3608,10 @@ var MllpClient = class extends EventEmitter {
3381
3608
  "ClientOptions.connectTimeoutMs must be an integer from 1 to 2147483647, or left unset for no bound"
3382
3609
  );
3383
3610
  }
3611
+ const tls = copyTlsOptions(opts.tls);
3612
+ checkCredentialMix(tls);
3613
+ this._pfxRefusal = typeof tls === "object" ? pfxRefusal(tls.pfx, tls.passphrase) : void 0;
3614
+ this._tls = tls;
3384
3615
  this._opts = opts;
3385
3616
  this._ackTimeoutMs = opts.ackTimeoutMs ?? 3e4;
3386
3617
  this._applicationAckTimeoutMs = opts.applicationAckTimeoutMs;
@@ -3427,10 +3658,22 @@ var MllpClient = class extends EventEmitter {
3427
3658
  * - `MllpConnectionError({ phase: 'connect', connectionCause: 'connect-timeout' })` if
3428
3659
  * {@link ClientOptions.connectTimeoutMs} is set and the TCP connect, or the TLS handshake
3429
3660
  * after it, did not complete in time. The socket is destroyed; nothing was written.
3661
+ * - `MllpConnectionError({ phase: 'connect' })` if {@link MllpClient.destroy} is called while
3662
+ * `connect()` is still connecting, over TCP or TLS, before or during the handshake. Its
3663
+ * `cause` is the reason passed to `destroy(reason)`, as it is, and its message is that
3664
+ * reason's; with no reason the cause is an `Error` whose message is `closed before connect`,
3665
+ * the same as for any socket that closes before connecting with no error. It carries no
3666
+ * `connectionCause` either way: a reason is the caller's own, so one whose message or `code`
3667
+ * reads like a TLS failure (`alert`, `ERR_SSL_*`, `EPROTO`, a certificate code) is never
3668
+ * sorted into `'tls-handshake'` or `'tls-verify'`. The first `destroy()` decides: a second
3669
+ * call before `connect()` settles, with a reason or without one, changes nothing.
3430
3670
  * - `MllpTlsConfigurationError` if the configured cipher-suite list cannot be
3431
- * honoured (the runtime rejects it, or `atnaTransportSecurity` and `ciphers`
3432
- * both declare one). Raised **before** a socket is opened, so nothing is left
3433
- * connected; identify it by `instanceof` plus its stable `code`.
3671
+ * honoured (the runtime rejects it, the runtime does not enforce cipher lists
3672
+ * at all, or `atnaTransportSecurity` and `ciphers` both declare one). Raised
3673
+ * **before** a socket is opened, so nothing is left connected; identify it by
3674
+ * `instanceof` plus its stable `code`.
3675
+ * - `MllpTlsConfigurationError` with `MLLP_TLS_PFX_REJECTED` if `tls.pfx` cannot be loaded
3676
+ * with `tls.passphrase` (see {@link TlsOptions.pfx}), also before a socket is opened.
3434
3677
  *
3435
3678
  * **Dual failure signal on initial connect:** the Connection's transport
3436
3679
  * error handler is attached before this promise's own error listener, so a
@@ -3471,12 +3714,14 @@ var MllpClient = class extends EventEmitter {
3471
3714
  if (signal !== void 0) {
3472
3715
  this._captureConnectSignal(signal);
3473
3716
  }
3717
+ this._destroyReason = null;
3474
3718
  return new Promise((resolve, reject) => {
3475
3719
  let aborted = false;
3476
3720
  const { socket, transport } = this._createSocketAndTransport();
3477
3721
  if (this._opts.keepaliveIntervalMs !== void 0) {
3478
3722
  socket.setKeepAlive(true, this._opts.keepaliveIntervalMs);
3479
3723
  }
3724
+ socket.setNoDelay(this._opts.noDelay !== false);
3480
3725
  this._socket = socket;
3481
3726
  const connOpts = this._opts.framing !== void 0 ? { transport, framing: this._opts.framing } : { transport };
3482
3727
  if (this._opts.drainTimeoutMs !== void 0) {
@@ -3484,7 +3729,7 @@ var MllpClient = class extends EventEmitter {
3484
3729
  }
3485
3730
  const conn = new Connection(connOpts);
3486
3731
  this._attachConnection(conn);
3487
- const connectEventName = this._opts.tls !== void 0 ? "secureConnect" : "connect";
3732
+ const connectEventName = this._tls !== void 0 ? "secureConnect" : "connect";
3488
3733
  this._armConnectTimeout(socket, connectEventName);
3489
3734
  const cleanup = () => {
3490
3735
  if (signal !== void 0) {
@@ -3492,6 +3737,7 @@ var MllpClient = class extends EventEmitter {
3492
3737
  }
3493
3738
  socket.removeListener(connectEventName, onSocketConnect);
3494
3739
  socket.removeListener("error", onSocketError);
3740
+ socket.removeListener("close", onSocketClose);
3495
3741
  };
3496
3742
  const abortHandler = () => {
3497
3743
  aborted = true;
@@ -3516,13 +3762,28 @@ var MllpClient = class extends EventEmitter {
3516
3762
  const onSocketError = (err) => {
3517
3763
  if (aborted) return;
3518
3764
  cleanup();
3765
+ if (err === this._destroyReason) {
3766
+ this._destroyReason = null;
3767
+ reject(new MllpConnectionError(err.message, { cause: err, phase: "connect" }));
3768
+ return;
3769
+ }
3519
3770
  reject(this._wrapConnectError(err, "connect"));
3520
3771
  };
3772
+ const onSocketClose = () => {
3773
+ cleanup();
3774
+ reject(
3775
+ new MllpConnectionError("connection closed before it was established", {
3776
+ cause: new Error("closed before connect"),
3777
+ phase: "connect"
3778
+ })
3779
+ );
3780
+ };
3521
3781
  if (signal !== void 0) {
3522
3782
  signal.addEventListener("abort", abortHandler, { once: true });
3523
3783
  }
3524
3784
  socket.once(connectEventName, onSocketConnect);
3525
3785
  socket.once("error", onSocketError);
3786
+ socket.once("close", onSocketClose);
3526
3787
  });
3527
3788
  }
3528
3789
  /**
@@ -3538,13 +3799,14 @@ var MllpClient = class extends EventEmitter {
3538
3799
  * against it.
3539
3800
  */
3540
3801
  _createSocketAndTransport() {
3541
- const tlsOpt = this._opts.tls;
3802
+ const tlsOpt = this._tls;
3542
3803
  if (tlsOpt === void 0) {
3543
3804
  const socket2 = createConnection({ host: this._opts.host, port: this._opts.port });
3544
3805
  return { socket: socket2, transport: new NetTransport(socket2) };
3545
3806
  }
3546
3807
  const tlsOpts = tlsOpt === true ? {} : tlsOpt;
3547
3808
  const cipherPolicy = resolveTlsCipherPolicy(tlsOpts, "client");
3809
+ if (this._pfxRefusal !== void 0) throw this._pfxRefusal;
3548
3810
  const socket = connect({
3549
3811
  host: this._opts.host,
3550
3812
  port: this._opts.port,
@@ -3553,6 +3815,7 @@ var MllpClient = class extends EventEmitter {
3553
3815
  ...tlsOpts.cert !== void 0 ? { cert: tlsOpts.cert } : {},
3554
3816
  ...tlsOpts.key !== void 0 ? { key: tlsOpts.key } : {},
3555
3817
  ...tlsOpts.passphrase !== void 0 ? { passphrase: tlsOpts.passphrase } : {},
3818
+ pfx: tlsOpts.pfx,
3556
3819
  minVersion: tlsOpts.minVersion ?? "TLSv1.2",
3557
3820
  ...tlsOpts.maxVersion !== void 0 ? { maxVersion: tlsOpts.maxVersion } : {},
3558
3821
  ...cipherPolicy,
@@ -3604,7 +3867,7 @@ var MllpClient = class extends EventEmitter {
3604
3867
  connectionCause: "connect-timeout"
3605
3868
  });
3606
3869
  }
3607
- if (this._opts.tls === void 0) {
3870
+ if (this._tls === void 0) {
3608
3871
  return new MllpConnectionError(err.message, { cause: err, phase });
3609
3872
  }
3610
3873
  const code = err.code;
@@ -3713,7 +3976,7 @@ var MllpClient = class extends EventEmitter {
3713
3976
  * connections or when verification is on.
3714
3977
  */
3715
3978
  _emitInsecureWarningIfNeeded() {
3716
- const tlsOpt = this._opts.tls;
3979
+ const tlsOpt = this._tls;
3717
3980
  if (tlsOpt === void 0 || tlsOpt === true) return;
3718
3981
  if (tlsOpt.allowUnverified !== true) return;
3719
3982
  const message = "MLLP TLS certificate verification is DISABLED (allowUnverified: true), this connection does not authenticate the peer.";
@@ -3738,7 +4001,7 @@ var MllpClient = class extends EventEmitter {
3738
4001
  * built at handshake-completion time, before any HL7 byte crosses the link.
3739
4002
  */
3740
4003
  _emitNegotiatedTlsParameters(socket) {
3741
- if (this._opts.tls === void 0) return;
4004
+ if (this._tls === void 0) return;
3742
4005
  const params = readNegotiatedTlsParameters(socket, this._opts.host, this._opts.port);
3743
4006
  if (params === null) return;
3744
4007
  this._emitContained("tlsNegotiated", params);
@@ -3981,7 +4244,7 @@ var MllpClient = class extends EventEmitter {
3981
4244
  }
3982
4245
  }
3983
4246
  }
3984
- const tlsProtocolShaped = this._opts.tls !== void 0 && isTlsProtocolError(err);
4247
+ const tlsProtocolShaped = this._tls !== void 0 && isTlsProtocolError(err);
3985
4248
  const classifiedAs = !tlsProtocolShaped && isTransientConnectionError(err) ? "transient" : "permanent";
3986
4249
  if (classifiedAs === "permanent") {
3987
4250
  this._userClosed = true;
@@ -4084,6 +4347,7 @@ var MllpClient = class extends EventEmitter {
4084
4347
  if (this._opts.keepaliveIntervalMs !== void 0) {
4085
4348
  socket.setKeepAlive(true, this._opts.keepaliveIntervalMs);
4086
4349
  }
4350
+ socket.setNoDelay(this._opts.noDelay !== false);
4087
4351
  this._socket = socket;
4088
4352
  const connOpts = this._opts.framing !== void 0 ? { transport, framing: this._opts.framing } : { transport };
4089
4353
  if (this._opts.drainTimeoutMs !== void 0) {
@@ -4095,7 +4359,7 @@ var MllpClient = class extends EventEmitter {
4095
4359
  this._emitInsecureWarningIfNeeded();
4096
4360
  this._emitNegotiatedTlsParameters(socket);
4097
4361
  };
4098
- const connectEventName = this._opts.tls !== void 0 ? "secureConnect" : "connect";
4362
+ const connectEventName = this._tls !== void 0 ? "secureConnect" : "connect";
4099
4363
  this._armConnectTimeout(socket, connectEventName);
4100
4364
  socket.once("error", (sErr) => {
4101
4365
  if (this._lastError === null || this._lastError.message !== sErr.message) {
@@ -4272,8 +4536,8 @@ var MllpClient = class extends EventEmitter {
4272
4536
  *
4273
4537
  * Resolves with the ACK Buffer (framing stripped). Rejects with:
4274
4538
  * - `DOMException('Aborted', 'AbortError')` if `signal` aborts before the ACK.
4275
- * - `MllpTimeoutError` if no ACK arrives within `ackTimeoutMs`.
4276
- * The clock starts at the underlying `write()` flush callback, NOT at
4539
+ * - `MllpTimeoutError` if no ACK arrives within `ackTimeoutMs` (this send's own, else the
4540
+ * client's). The clock starts at the underlying `write()` flush callback, NOT at
4277
4541
  * the `send()` call.
4278
4542
  * - `MllpConnectionError({ phase: 'send' })` if the client is not connected.
4279
4543
  *
@@ -4302,7 +4566,10 @@ var MllpClient = class extends EventEmitter {
4302
4566
  *
4303
4567
  * @param payload Raw bytes; MLLP framing is added internally via `encodeFrame`.
4304
4568
  * @param opts.signal AbortSignal, aborting cancels the ACK wait.
4305
- * @param opts.ackTimeoutMs Per-send override of the backpressure wait budget.
4569
+ * @param opts.ackTimeoutMs This send's bound on the wait for its acknowledgement, from the
4570
+ * moment its bytes are flushed, in place of the client's `ackTimeoutMs`. Under
4571
+ * `onBackpressure: "wait"` it also bounds the wait for queue room, and the
4572
+ * acknowledgement wait then starts afresh once the send is written.
4306
4573
  * @param opts.applicationAckTimeoutMs Per-send override of the second wait's bound.
4307
4574
  * @param opts.onCommitAck Called with the commit disposition when the peer commits the
4308
4575
  * message ahead of its application acknowledgement. See {@link CommitAckReport}.
@@ -4357,21 +4624,34 @@ var MllpClient = class extends EventEmitter {
4357
4624
  opts
4358
4625
  );
4359
4626
  }
4627
+ const sendAckTimeoutMs = opts?.ackTimeoutMs;
4360
4628
  return new Promise((resolve, reject) => {
4361
4629
  let abortListener = null;
4362
- const wrappedResolve = (ack) => {
4630
+ let ackDeadline;
4631
+ let settled = false;
4632
+ const settle = () => {
4633
+ settled = true;
4363
4634
  if (signal !== void 0 && abortListener !== null) {
4364
4635
  signal.removeEventListener("abort", abortListener);
4365
4636
  }
4637
+ clearTimeout(ackDeadline);
4638
+ };
4639
+ const wrappedResolve = (ack) => {
4640
+ settle();
4366
4641
  resolve(ack);
4367
4642
  };
4368
4643
  const wrappedReject = (err) => {
4369
- if (signal !== void 0 && abortListener !== null) {
4370
- signal.removeEventListener("abort", abortListener);
4371
- }
4644
+ settle();
4372
4645
  reject(err);
4373
4646
  };
4374
- const key = correlator.enqueue(frame, controlId, wrappedResolve, wrappedReject, twoPhase);
4647
+ const key = correlator.enqueue(
4648
+ frame,
4649
+ controlId,
4650
+ wrappedResolve,
4651
+ wrappedReject,
4652
+ twoPhase,
4653
+ sendAckTimeoutMs
4654
+ );
4375
4655
  if (key === null) {
4376
4656
  const parked = { cancel: () => void 0 };
4377
4657
  const neverDelivered = () => new MllpNeverDeliveredError({
@@ -4413,6 +4693,12 @@ var MllpClient = class extends EventEmitter {
4413
4693
  }
4414
4694
  conn.send(frame);
4415
4695
  correlator.markFlushed(key, Date.now());
4696
+ if (sendAckTimeoutMs !== void 0 && !settled) {
4697
+ ackDeadline = setTimeout(() => {
4698
+ correlator.expireDue();
4699
+ }, sendAckTimeoutMs);
4700
+ ackDeadline.unref();
4701
+ }
4416
4702
  this._sentTotal += 1;
4417
4703
  });
4418
4704
  }
@@ -4809,6 +5095,12 @@ var MllpClient = class extends EventEmitter {
4809
5095
  * ever written for it; that is a statement about the bytes, not about how the client was
4810
5096
  * shut down, so it holds on this path too.
4811
5097
  *
5098
+ * A {@link MllpClient.connect} still connecting rejects with an `MllpConnectionError` whose
5099
+ * `phase` is `'connect'` and no `connectionCause`. Its `cause` is `reason` when one is given,
5100
+ * never classified as a TLS failure whatever its message or `code`, and otherwise an `Error`
5101
+ * whose message is `closed before connect`. Only the first call reaches the socket, so a
5102
+ * second `destroy()` before `connect()` settles, with or without a reason, changes nothing.
5103
+ *
4812
5104
  * @example
4813
5105
  * ```typescript
4814
5106
  * client.destroy(new Error('shutting down'));
@@ -4829,6 +5121,7 @@ var MllpClient = class extends EventEmitter {
4829
5121
  this._teardownCorrelator(teardownReason);
4830
5122
  const conn = this._connection;
4831
5123
  if (conn === null) return;
5124
+ if (conn.state === "CONNECTING") this._destroyReason = reason ?? null;
4832
5125
  conn.destroy(reason);
4833
5126
  }
4834
5127
  /**
@@ -4874,7 +5167,7 @@ var MllpClient = class extends EventEmitter {
4874
5167
  reconnectAttempts: this._reconnectAttempts,
4875
5168
  lastConnectedAt: this._lastConnectedAt,
4876
5169
  lastAckAt: this._lastAckAt,
4877
- tls: this._opts.tls !== void 0
5170
+ tls: this._tls !== void 0
4878
5171
  };
4879
5172
  }
4880
5173
  /**
@@ -4909,6 +5202,7 @@ async function createStarterClient(opts) {
4909
5202
  ...opts.retryStrategy !== void 0 ? { retryStrategy: opts.retryStrategy } : {},
4910
5203
  ...opts.keepaliveIntervalMs !== void 0 ? { keepaliveIntervalMs: opts.keepaliveIntervalMs } : {},
4911
5204
  ...opts.deadPeerTimeoutMs !== void 0 ? { deadPeerTimeoutMs: opts.deadPeerTimeoutMs } : {},
5205
+ noDelay: opts.noDelay !== false,
4912
5206
  ...opts.connectTimeoutMs !== void 0 ? { connectTimeoutMs: opts.connectTimeoutMs } : {},
4913
5207
  ...opts.tls !== void 0 ? { tls: opts.tls } : {}
4914
5208
  };
@@ -5230,8 +5524,8 @@ async function runDifferential(options = {}) {
5230
5524
  }
5231
5525
 
5232
5526
  // src/index.ts
5233
- var VERSION = "0.1.11";
5527
+ var VERSION = "0.1.13";
5234
5528
 
5235
- export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_CONNECTION_LIMIT_REACHED, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, VERSION, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer, createWarning, differentialConfigurationMessage, encodeFrame, isTlsProtocolError, isTlsVerificationErrorCode, isTransientConnectionError, rawAckUncorrelatable, readNegotiatedTlsParameters, resolveDifferentialPeer, resolveNackCode, resolveTlsCipherPolicy, runDifferential, tlsConfigurationMessage };
5529
+ export { ATNA_CIPHER_LIST, ATNA_CIPHER_SUITES, Connection, FrameReader, MLLP_BIND_ALL_INTERFACES, MLLP_CONNECTION_LIMIT_REACHED, MLLP_DIFF_PEER_UNPARSEABLE, MLLP_TLS_CIPHER_LIST_REJECTED, MLLP_TLS_CIPHER_LIST_UNENFORCEABLE, MLLP_TLS_CIPHER_OPTION_CONFLICT, MLLP_TLS_CREDENTIAL_CONFLICT, MLLP_TLS_DH_PARAMETERS_REJECTED, MLLP_TLS_DH_PARAMETERS_UNENFORCEABLE, MLLP_TLS_OPTIONS_NOT_AN_OBJECT, MLLP_TLS_PFX_REJECTED, MLLP_TLS_VERIFY_DISABLED, MllpAckError, MllpApplicationAckError, MllpBackpressureError, MllpClient, MllpCommitRejectedError, MllpConnectionError, MllpDifferentialConfigurationError, MllpFramingError, MllpNeverDeliveredError, MllpServer, MllpTimeoutError, MllpTlsConfigurationError, MllpUnknownFateError, NetTransport, TLS13_DEFAULT_CIPHER_SUITES, TlsTransport, VERSION, ackDiagnosticMessage, ackModeDiagnosticMessage, buildRawAck, canonicalAcknowledgement, canonicalExchanges, createClient, createServer, createStarterClient, createStarterServer, createWarning, differentialConfigurationMessage, encodeFrame, isTlsProtocolError, isTlsVerificationErrorCode, isTransientConnectionError, rawAckUncorrelatable, readNegotiatedTlsParameters, resolveDifferentialPeer, resolveNackCode, resolveTlsCipherPolicy, runDifferential, selectAckCode, tlsConfigurationMessage };
5236
5530
  //# sourceMappingURL=index.mjs.map
5237
5531
  //# sourceMappingURL=index.mjs.map