Closed sivasubm1 closed 1 year ago
Hi. To solve this problem, you could add breakpoint on connect in CocoaMQTTWebSocket.swift file.
Did found any solution on this ?
Did found any solution on this ?
Maybe this problem happens because the certificate used for SSL is not trusted.
This is a TLS issue, not much for cocoamqtt could do
I followed the exact code strategy of CocoaMqtt. I am trying to connect MQTT over WSS , but my url is appended with https instead of wss. So i am getting NSLocalizedDescription=A server with the specified hostname could not be found.}
emitted url - https://msgvip.s05590.us.mal-baro.com:58415/mqtt
expected url - wss://msgvip.s05590.us.mal-baro.com:58415/mqtt
pod installed - pod 'CocoaMQTT' pod 'CocoaMQTT/WebSockets'
code followed: import CocoaMQTT
class MqttManager: NSObject , ObservableObject {
var mqttClient: CocoaMQTT? var mqtt: CocoaMQTT5? var identifier: String! var host: String! var topic: String! var userName: String! var password: String!
func intializeMqtt(host: String, identifier: String, userName: String? = nil , password: String? = nil){
if mqttClient != nil { mqttClient = nil }
}
}