robhogan / react-native-paho-mqtt

react-native-paho-mqtt
91 stars 32 forks source link

Connect to unencrypted Broker in Android 13 SDKVersion 33 #45

Open GaWr26 opened 11 months ago

GaWr26 commented 11 months ago

We're using a Broker without TLS encryption for our IoT device. After upgrading to Android 13 with SDK Version 33 the connection can't be established anymore. Is there a way to get the connection working without a certificate or do we now need to encrypt?

Thanks for any hints on this!

GaWr26 commented 10 months ago

So, I've done some additional testing and it seems encryption doesn't seem to be the issue. When connecting to a hive mq cloud broker, the connection works. A local connection via WiFi and IP address does not work anymore. Before the upgrade it worked as expected. I enabled TLS encryption on our local broker but still no success. I can't even see any requests coming in on the broker. Seems the issue has to do with the local connection via WiFi and IP address. Maybe traffic is routed via cellular? We use WiFi reborn's useWifiWithOptions which did the trick prior to Android 13. Anybody here aware of the changes on Android 13 regarding websocket connection via WiFi on a local network?

Also want to mention when debugging a expo dev build the broker connection works. It does not in the release build though.

I'm a bit lost and don't know how to get things working again at the moment... Any help is highly appreciated 👍

bearkillerPT commented 10 months ago

I have the exact same issue... Testing on Expo Go works fine but not on a local build. This happens when upgrading to Expo sdk 49. Not sure what's up but it needs fixing.

bearkillerPT commented 5 months ago

@GaWr26 I assume the answer I got should also help you!

GaWr26 commented 2 months ago
 'expo-build-properties',
{
      android: {
             usesCleartextTraffic: true,
      },
},

did the trick for me