emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.59k stars 418 forks source link

Can’t connect to mosquitto server via websocket, regular connection works #337

Open bdruth opened 4 years ago

bdruth commented 4 years ago

Not sure what’s going on, but I have a website using the paho-mqtt client over secure websocket. All good. Unfortunately, CocoaMQTT isn’t able to connect, securely or otherwise. No errors, other than what appears to be a timeout after 90s. State changes to connecting, never gets to connected. Connecting directly via MQTT protocol works fine.

What additional info can I give to help get this sorted?

jeremy-meier commented 4 years ago

I was having a similar issue implementing websockets. Are you implementing the func mqtt(_ mqtt: CocoaMQTT, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void) method of the CocoaMQTTDelegate protocol? Still haven't figured out why, but implementing that method got me connected.