mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
fix(apple): localize TLS connection problems
This commit is contained in:
@@ -764,8 +764,10 @@ extension GatewayConnectionProblemMapper {
|
||||
title: "Gateway certificate unavailable",
|
||||
message: "OpenClaw could not securely save the TLS certificate pin for \(failure.host).",
|
||||
actionLabel: "Retry",
|
||||
messagePresentation: .verbatim(
|
||||
"OpenClaw could not securely save the TLS certificate pin for \(failure.host)."),
|
||||
titlePresentation: .localized("Gateway certificate unavailable"),
|
||||
messagePresentation: .localizedFormat(
|
||||
"OpenClaw could not securely save the TLS certificate pin for %@.",
|
||||
[failure.host]),
|
||||
actionLabelPresentation: .localized("Retry"),
|
||||
actionCommand: nil,
|
||||
docsURL: URL(string: "https://docs.openclaw.ai/gateway/troubleshooting"),
|
||||
@@ -779,7 +781,8 @@ extension GatewayConnectionProblemMapper {
|
||||
title: "Gateway certificate is not trusted",
|
||||
message: "The TLS challenge came from a different host or port than the requested Gateway.",
|
||||
actionLabel: "Check certificate",
|
||||
messagePresentation: .verbatim(
|
||||
titlePresentation: .localized("Gateway certificate is not trusted"),
|
||||
messagePresentation: .localized(
|
||||
"The TLS challenge came from a different host or port than the requested Gateway."),
|
||||
actionLabelPresentation: .localized("Check certificate"),
|
||||
actionCommand: nil,
|
||||
|
||||
@@ -317,6 +317,10 @@ struct GatewayErrorsTests {
|
||||
#expect(problem?.retryable == true)
|
||||
#expect(problem?.pauseReconnect == false)
|
||||
#expect(problem?.actionLabel == "Retry")
|
||||
#expect(problem?.titlePresentation == .localized("Gateway certificate unavailable"))
|
||||
#expect(problem?.messagePresentation == .localizedFormat(
|
||||
"OpenClaw could not securely save the TLS certificate pin for %@.",
|
||||
["gateway.example.com"]))
|
||||
}
|
||||
|
||||
@Test func `TLS authority mismatch pauses reconnect`() {
|
||||
@@ -337,6 +341,9 @@ struct GatewayErrorsTests {
|
||||
#expect(problem?.retryable == false)
|
||||
#expect(problem?.pauseReconnect == true)
|
||||
#expect(problem?.actionLabel == "Check certificate")
|
||||
#expect(problem?.titlePresentation == .localized("Gateway certificate is not trusted"))
|
||||
#expect(problem?.messagePresentation == .localized(
|
||||
"The TLS challenge came from a different host or port than the requested Gateway."))
|
||||
}
|
||||
|
||||
@Test func `untrusted TLS mismatch cannot be recovered in app`() {
|
||||
|
||||
Reference in New Issue
Block a user