mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove impossible cases
This commit is contained in:
parent
449a72c807
commit
be5540eda5
1 changed files with 2 additions and 10 deletions
|
|
@ -8,6 +8,7 @@
|
|||
import Foundation
|
||||
import CocoaMQTT
|
||||
import OSLog
|
||||
import Security
|
||||
|
||||
protocol MqttClientProxyManagerDelegate: AnyObject {
|
||||
func onMqttConnected()
|
||||
|
|
@ -131,16 +132,7 @@ extension MqttClientProxyManager: CocoaMQTTDelegate {
|
|||
}
|
||||
}
|
||||
func mqtt(_ mqtt: CocoaMQTT, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void) {
|
||||
var isValid = false
|
||||
#if canImport(Security)
|
||||
if #available(macOS 10.15, iOS 13.0, *) {
|
||||
isValid = SecTrustEvaluateWithError(trust, nil)
|
||||
} else {
|
||||
var result: SecTrustResultType = .invalid
|
||||
let status = SecTrustEvaluate(trust, &result)
|
||||
isValid = (status == errSecSuccess) && (result == .unspecified || result == .proceed)
|
||||
}
|
||||
#endif
|
||||
let isValid = SecTrustEvaluateWithError(trust, nil)
|
||||
if isValid {
|
||||
Logger.mqtt.info("📲 [MQTT Client Proxy] TLS validation succeeded.")
|
||||
completionHandler(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue