Archived
feat: center square Hope presence and guide secure certificate setup
This commit is contained in:
1 parent
6f2659421c
commit
15c6389ffb
12 files changed
+252
-129
No files matched your search
@@ -32,6 +32,17 @@ struct AuthLoginResponse: Decodable {
|
||||
}
|
||||
|
||||
}
|
||||
enum ConnectionFailure {
|
||||
static func message(_ error: Error, server: URL) -> String {
|
||||
let ns = error as NSError
|
||||
let certificateCodes: Set<Int> = [-1200, -1201, -1202, -1203, -1204, -1205, -1206]
|
||||
if ns.domain == NSURLErrorDomain && certificateCodes.contains(ns.code) {
|
||||
return "The certificate for \(server.host ?? "this server") is not trusted. For your private Hope server, install the verified certificate profile in Safari, then enable it in Settings → General → About → Certificate Trust Settings. Do not continue if the server address is unfamiliar."
|
||||
}
|
||||
return error.localizedDescription
|
||||
}
|
||||
}
|
||||
|
||||
enum AuthError: LocalizedError {
|
||||
case status(Int)
|
||||
case invalidResponse
|
||||
|
||||
Reference in new issue
Block a user