Closed yusufonderd closed 1 year ago
ok i fixed to issue. Here is the solution:
let clientID = "CocoaMQTT-" + String(ProcessInfo().processIdentifier) + "\(randomInt)"
let websocket = CocoaMQTTWebSocket(uri: url)
websocket.shouldConnectWithURIOnly = true
self.mqtt = CocoaMQTT(clientID: clientID,
host: "",
port: 0,
socket: websocket)
self.mqtt?.enableSSL = true
self.mqtt?.autoReconnect = true
self.mqtt?.allowUntrustCACertificate = true
self.mqtt?.delegate = self
_ = self.mqtt?.connect()
NSURLErrorWebSocketHandshakeFailureReasonKey=0