Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MqttException (0) - java.io.IOException: WebSocket Response header: Invalid response from Server, It may not support WebSockets. #3646

Open
kushagrakumar27 opened this issue Nov 6, 2024 · 2 comments
Labels
iot Issues with the AWS Android SDK for Internet of Things (IoT) pending-maintainer-response Issue is pending response from an Amplify team member question General question

Comments

@kushagrakumar27
Copy link

Language:
Kotlin

Gradle dependencies:

implementation("org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5")
implementation("org.eclipse.paho:org.eclipse.paho.android.service:1.1.1")
implementation("com.amazonaws:aws-android-sdk-iot:2.77.0")

Description:

I am using Custom authorizer to establish connection to MQTT broker (configured on AWS IoT domain). The domain is configured as follows:

Security policy - loTSecurityPolicy_TLS12_1_2_2022_10
Authentication type - Custom authorizer
Application protocol - Secure MQTT

I have attached the MQTT_log_exception file which contains the IOException that I am getting.
MQTT_log_exception.txt

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Nov 6, 2024
@mattcreaser
Copy link
Member

Hi @kushagrakumar27. For IoT we strongly recommend you switch to the AWS IoT Device SDK for Java v2 - that library is very actively maintained and you will be able to get better support there. They have documentation about using that library on Android.

In terms of this specific exception, it's coming from the underlying Paho Client. There's not a lot of visibility into what is going wrong, but it seems that this error can result from issues authenticating the connection.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Nov 6, 2024
@mattcreaser mattcreaser added question General question iot Issues with the AWS Android SDK for Internet of Things (IoT) pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-maintainer-response Issue is pending response from an Amplify team member labels Nov 6, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Nov 6, 2024
@kushagrakumar27
Copy link
Author

Hi @mattcreaser. Thanks for the library suggestion.
Does com.amazonaws:aws-android-sdk-iot support only MQTT over secure websockets as the Application protocol, or does it also support Secure MQTT (that uses TLS)?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iot Issues with the AWS Android SDK for Internet of Things (IoT) pending-maintainer-response Issue is pending response from an Amplify team member question General question
Projects
None yet
Development

No branches or pull requests

2 participants