fix: remove conflicting ATS CA pin and verify physical LiveKit trust
This commit is contained in:
1 parent
15c6389ffb
commit
5b41b3924a
5 files changed
+32
-22
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import Foundation
|
||||
import LiveKit
|
||||
import Testing
|
||||
@testable import Voice
|
||||
|
||||
@@ -15,6 +16,14 @@ struct TLSLiveTests {
|
||||
#expect(!data.isEmpty)
|
||||
}
|
||||
|
||||
@Test func systemTrustedLANHTTPS() async throws {
|
||||
guard ProcessInfo.processInfo.environment["HOPE_TLS_LIVE"] == "1" else { return }
|
||||
print("HOPE_TLS_PROBE system trust validation started")
|
||||
let (_, response) = try await URLSession.shared.data(from: URL(string: "https://192.168.86.2:9178/api/auth/me")!)
|
||||
#expect((response as? HTTPURLResponse)?.statusCode == 401)
|
||||
print("HOPE_TLS_PROBE system trust validation completed")
|
||||
}
|
||||
|
||||
@Test func nativeAccountLogin() async throws {
|
||||
let env = ProcessInfo.processInfo.environment
|
||||
guard env["HOPE_TLS_LIVE"] == "1", let username = env["HOPE_TEST_USERNAME"],
|
||||
@@ -25,6 +34,12 @@ struct TLSLiveTests {
|
||||
let login = try await client.login(username: username, password: password)
|
||||
#expect(login.user.username == username)
|
||||
#expect(try await client.me(token: login.token).id == login.user.id)
|
||||
let bootstrap = try await TokenClient(config: config, bearerToken: login.token).fetchToken()
|
||||
let room = Room()
|
||||
try await room.connect(url: config.livekitURL.absoluteString, token: bootstrap.token)
|
||||
#expect(room.connectionState == .connected)
|
||||
await room.disconnect()
|
||||
print("HOPE_TLS_PROBE authenticated LiveKit WSS connected and disconnected; microphone not enabled")
|
||||
try await client.logout(token: login.token)
|
||||
print("HOPE_TLS_PROBE native login/me/logout completed")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user