Open lygialiem opened 1 year ago
Hi. Make sure your broker config is consistent with your writing code. Thanks.
please find the corresponding TLS/SSL log from broker side, this usually caused by malformed certificate or the version of SSL lib mismatch
I took several days to solve the set allowUntrustCACertificate = true, unable to connect the SSL problems, finally through the source code, found that need to implement the following method
// Optional ssl CocoaMQTTDelegate func mqtt(_ mqtt: CocoaMQTT, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void) { TRACE("trust: (trust)") /// Validate the server certificate /// /// Some custom validation... /// /// if validatePassed { /// completionHandler(true) /// } else { /// completionHandler(false) /// } completionHandler(true) }
Hi team.
Currently, I setup MQTT connection like this:
but i always get this error: "Socket closed by remote peer". Did i miss something?
Thank you and Best Regard