emqx / CocoaMQTT

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

Not able to connect hivemq.cloud TLS/SSL port(8883). #565

Closed snr-lab closed 8 months ago

snr-lab commented 8 months ago

I am getting following error while trying to connect to hivemq.cloud TLS/SSL port(8883).

2023-11-04 23:02:33.126929+0530 Dev[7442:858287] [connection] nw_connection_copy_connected_path_block_invoke [C6] Client called nw_connection_copy_connected_path on unconnected nw_connection 2023-11-04 23:02:33.127087+0530 Dev[7442:858287] [] tcp_connection_is_cellular No connected path

Error Domain=MGCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo={NSLocalizedDescription=Socket closed by remote peer}

However I am able to connect to the same broker from Android (Paho JAVA library)

Please help me to fix this issue.

Let me know if any other information is required.

leeway1208 commented 8 months ago

Please provide us with your demo.

snr-lab commented 8 months ago

CocoaMQTT.zip

I have attached a demo application (MQTT v3.1.1) to reproduce the issue To verify if the credentials are correct you can use this Android app to test.

https://play.google.com/store/apps/details?id=snr.lab.iotmqttpanel.prod

leeway1208 commented 8 months ago

CocoaMQTT_reply.zip Hello. Please refer to this demo .

snr-lab commented 8 months ago

Thanks @leeway1208

The application is working now.