惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(android): prompt on changed TLS thumbprint · openclaw...
sliekens · 2026-05-17 · via Recent Commits to openclaw:main

@@ -10,6 +10,7 @@ import ai.openclaw.app.node.InvokeDispatcher

1010

import ai.openclaw.app.protocol.OpenClawTalkCommand

1111

import ai.openclaw.app.voice.TalkModeManager

1212

import android.Manifest

13+

import kotlinx.coroutines.CompletableDeferred

1314

import kotlinx.coroutines.flow.MutableStateFlow

1415

import kotlinx.coroutines.runBlocking

1516

import org.junit.Assert.assertEquals

@@ -153,7 +154,7 @@ class GatewayBootstrapAuthTest {

153154

NodeRuntime(

154155

app,

155156

prefs,

156-

tlsFingerprintProbe = { _, _ -> GatewayTlsProbeResult(fingerprintSha256 = "fp-1") },

157+

tlsFingerprintProbe = { _, _ -> GatewayTlsProbeResult(fingerprintSha256 = "fp:1") },

157158

)

158159

val endpoint = GatewayEndpoint.manual(host = "gateway.example", port = 18789)

159160

val explicitAuth =

@@ -169,11 +170,93 @@ class GatewayBootstrapAuthTest {

169170170171

runtime.acceptGatewayTrustPrompt()

171172172-

assertEquals("fp-1", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

173-

assertEquals("setup-bootstrap-token", desiredBootstrapToken(runtime, "nodeSession"))

173+

assertEquals("f1", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

174+

assertEquals("setup-bootstrap-token", waitForDesiredBootstrapToken(runtime, "nodeSession"))

174175

assertNull(desiredBootstrapToken(runtime, "operatorSession"))

175176

}

176177178+

@Test

179+

fun connect_promptsBeforeReplacingChangedTlsFingerprint() =

180+

runBlocking {

181+

val app = RuntimeEnvironment.getApplication()

182+

val securePrefs =

183+

app.getSharedPreferences(

184+

"openclaw.node.secure.test.${UUID.randomUUID()}",

185+

android.content.Context.MODE_PRIVATE,

186+

)

187+

val prefs = SecurePrefs(app, securePrefsOverride = securePrefs)

188+

val endpoint = GatewayEndpoint.manual(host = "gateway.example", port = 18789)

189+

prefs.saveGatewayTlsFingerprint(endpoint.stableId, "sha256:aa:aa:aa:aa")

190+

val runtime =

191+

NodeRuntime(

192+

app,

193+

prefs,

194+

tlsFingerprintProbe = { _, _ -> GatewayTlsProbeResult(fingerprintSha256 = "sha256:bb:bb:bb:bb") },

195+

)

196+197+

runtime.connect(

198+

endpoint,

199+

NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = null, password = null),

200+

)

201+202+

val prompt = waitForGatewayTrustPrompt(runtime)

203+

assertEquals("aaaaaaaa", prompt.previousFingerprintSha256)

204+

assertEquals("bbbbbbbb", prompt.fingerprintSha256)

205+

assertEquals("sha256:aa:aa:aa:aa", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

206+207+

runtime.declineGatewayTrustPrompt()

208+209+

assertEquals("sha256:aa:aa:aa:aa", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

210+211+

runtime.connect(

212+

endpoint,

213+

NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = null, password = null),

214+

)

215+

waitForGatewayTrustPrompt(runtime)

216+

runtime.acceptGatewayTrustPrompt()

217+218+

assertEquals("bbbbbbbb", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

219+

}

220+221+

@Test

222+

fun connect_ignoresStaleTlsProbeAfterDisconnect() =

223+

runBlocking {

224+

val app = RuntimeEnvironment.getApplication()

225+

val securePrefs =

226+

app.getSharedPreferences(

227+

"openclaw.node.secure.test.${UUID.randomUUID()}",

228+

android.content.Context.MODE_PRIVATE,

229+

)

230+

val prefs = SecurePrefs(app, securePrefsOverride = securePrefs)

231+

val endpoint = GatewayEndpoint.manual(host = "gateway.example", port = 18789)

232+

prefs.saveGatewayTlsFingerprint(endpoint.stableId, "aaaaaaaa")

233+

val probeStarted = CompletableDeferred<Unit>()

234+

val probeResult = CompletableDeferred<GatewayTlsProbeResult>()

235+

val runtime =

236+

NodeRuntime(

237+

app,

238+

prefs,

239+

tlsFingerprintProbe = { _, _ ->

240+

probeStarted.complete(Unit)

241+

probeResult.await()

242+

},

243+

)

244+245+

runtime.connect(

246+

endpoint,

247+

NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = null, password = null),

248+

)

249+

probeStarted.await()

250+251+

runtime.disconnect()

252+

probeResult.complete(GatewayTlsProbeResult(fingerprintSha256 = "aaaaaaaa"))

253+

Thread.sleep(100)

254+255+

assertNull(runtime.pendingGatewayTrust.value)

256+

assertNull(desiredBootstrapToken(runtime, "nodeSession"))

257+

assertEquals("aaaaaaaa", prefs.loadGatewayTlsFingerprint(endpoint.stableId))

258+

}

259+177260

@Test

178261

fun connect_showsSecureEndpointGuidanceWhenTlsProbeFails() {

179262

val app = RuntimeEnvironment.getApplication()

@@ -269,6 +352,21 @@ class GatewayBootstrapAuthTest {

269352

return readField(desired, "bootstrapToken")

270353

}

271354355+

private fun waitForDesiredBootstrapToken(

356+

runtime: NodeRuntime,

357+

sessionFieldName: String,

358+

): String {

359+

var lastObserved: String? = null

360+

repeat(50) {

361+

desiredBootstrapToken(runtime, sessionFieldName)?.let { token ->

362+

lastObserved = token

363+

return token

364+

}

365+

Thread.sleep(10)

366+

}

367+

error("Expected desired bootstrap token for $sessionFieldName; last observed=$lastObserved")

368+

}

369+272370

private fun <T> readField(

273371

target: Any,

274372

name: String,