fix(android): preserve private LAN TLS pins · openclaw/openclaw@633c40a
obviyus
·
2026-05-28
·
via Recent Commits to openclaw:main
File tree
main/java/ai/openclaw/app/node
test/java/ai/openclaw/app/node
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,6 @@ class ConnectionManager(
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if (isManual) { |
47 | | -if (!manualTlsEnabled && cleartextAllowedHost) return null |
48 | 47 | if (!stored.isNullOrBlank()) { |
49 | 48 | return GatewayTlsParams( |
50 | 49 | required = true, |
@@ -53,6 +52,7 @@ class ConnectionManager(
|
53 | 52 | stableId = stableId, |
54 | 53 | ) |
55 | 54 | } |
| 55 | +if (!manualTlsEnabled && cleartextAllowedHost) return null |
56 | 56 | return GatewayTlsParams( |
57 | 57 | required = true, |
58 | 58 | expectedFingerprint = null, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,6 +122,22 @@ class ConnectionManagerTest {
|
122 | 122 | assertNull(params) |
123 | 123 | } |
124 | 124 | |
| 125 | + @Test |
| 126 | +fun resolveTlsParamsForEndpoint_manualPrivateLanPreservesStoredPin() { |
| 127 | +val endpoint = GatewayEndpoint.manual(host = "192.168.1.20", port = 18789) |
| 128 | + |
| 129 | +val params = |
| 130 | +ConnectionManager.resolveTlsParamsForEndpoint( |
| 131 | + endpoint, |
| 132 | + storedFingerprint = "pinned", |
| 133 | + manualTlsEnabled = false, |
| 134 | + ) |
| 135 | + |
| 136 | + assertEquals(true, params?.required) |
| 137 | + assertEquals("pinned", params?.expectedFingerprint) |
| 138 | + assertEquals(false, params?.allowTOFU) |
| 139 | + } |
| 140 | + |
125 | 141 | @Test |
126 | 142 | fun resolveTlsParamsForEndpoint_discoveryTailnetWithoutHintsStillRequiresTls() { |
127 | 143 | val endpoint = |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。