You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@SgtSilvio Can you please help us fix this? We are blocked to deploy MQTT support on Android 4.4.2 and lower
We have found a working solution to enable TLSv1.2 by using Google ProviderInstaller
We cannot guarantee to have GooglePlayServices installed on every device. So we cannot rely on it.
We have found another solution to enable TLSv1.2 on OkHttpClient but that wouldn't help us enabling the same on hivemqclient
Please ask this question on the HiveMQ Community Forum (https://community.hivemq.com/) as this is not directly related with the HiveMQ MQTT client and you might find help from other people there.
Expected behavior
Mqtt5Client should connect with specified protocol version
Actual behavior
com.hivemq.client.mqtt.exceptions.ConnectionFailedException: java.lang.IllegalArgumentException: Protocol TLSv1.2 is not supported.
To Reproduce
Steps
mqttClientBuilder.sslConfig()
.protocols(Collections.singletonList(TlsVersion.TLS_1_2.javaName()))
.applySslConfig()
.buildAsync();
Reproducer code
Mqtt5ClientBuilder mqttClientBuilder = MqttClient.builder()
.useMqttVersion5()
.identifier(deviceId)
.serverHost(appContext.getString(R.string.mqtt_wss_broker))
.serverPort(443)
.webSocketConfig(MqttWebSocketConfig.builder().serverPath("mqtt").build())
.automaticReconnectWithDefaultConfig()
.addConnectedListener(context -> {
setMqttClientConnected(true);
Log.i(Util.TAG, LOG_LABEL + " Mqtt client connected");
publishOnline(appContext);
})
.addDisconnectedListener(context -> {
setMqttClientConnected(false);
Log.e(Util.TAG, LOG_LABEL + " Mqtt client disconnected");
LogUtils.logException(new Exception(context.getCause()), LOG_LABEL);
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mqttClientBuilder = mqttClientBuilder.sslWithDefaultConfig();
} else {
mqttClientBuilder = mqttClientBuilder.sslConfig()
.protocols(Collections.singletonList(TlsVersion.TLS_1_2.javaName()))
.applySslConfig();
}
mqttClient = mqttClientBuilder.buildAsync();
Details
The text was updated successfully, but these errors were encountered: