























@@ -103,4 +103,34 @@ describe("registerNodeCli", () => {
103103expect.objectContaining({ gatewayHost: "10.0.0.2", gatewayPort: 19001 }),
104104);
105105});
106+107+it("inherits saved TLS settings only when using the saved gateway endpoint", async () => {
108+daemonMocks.loadNodeHostConfig.mockResolvedValue({
109+version: 1,
110+nodeId: "node-existing",
111+gateway: {
112+host: "10.0.0.2",
113+port: 19001,
114+tls: true,
115+tlsFingerprint: "old-fingerprint",
116+},
117+});
118+119+await createProgram().parseAsync(["node", "run"], { from: "user" });
120+expect(daemonMocks.runNodeHost).toHaveBeenLastCalledWith(
121+expect.objectContaining({
122+gatewayTls: true,
123+gatewayTlsFingerprint: "old-fingerprint",
124+}),
125+);
126+127+await createProgram().parseAsync(["node", "run", "--host", "10.0.0.3"], { from: "user" });
128+expect(daemonMocks.runNodeHost).toHaveBeenLastCalledWith(
129+expect.objectContaining({
130+gatewayHost: "10.0.0.3",
131+gatewayTls: undefined,
132+gatewayTlsFingerprint: undefined,
133+}),
134+);
135+});
106136});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。