software.amazon.awssdk.crt.mqtt.MqttException: TLS (SSL) negotiation failed

0

I am currently developing a Java application using the AWS IoT SDK for MQTT communication. However, I've encountered issues with configuring the MQTT connection parameters and integrating the necessary certificates.

Here are the steps I followed: Created a thing on the AWS console. Selected the Java and Windows SDK stack. Downloaded the connection kit, which includes my certificate files and a start.ps1 script. When executing .\start.ps1, I encountered the following error:

I have attached relevant details and logs for your reference. Running the pub/sub sample application... [INFO] Scanning for projects... [INFO] [INFO] ----------< software.amazon.awssdk.iotdevicesdk:BasicPubSub >----------- [INFO] Building software.amazon.awssdk.iotdevicesdk:BasicPubSub 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- exec:1.4.0:java (default-cli) @ BasicPubSub --- [WARNING] java.lang.reflect.InvocationTargetException at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:118) at java.lang.reflect.Method.invoke (Method.java:580) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293) at java.lang.Thread.run (Thread.java:1570) Caused by: java.lang.RuntimeException: Exception occurred during connect at pubsub.PubSub.main (PubSub.java:100) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293) at java.lang.Thread.run (Thread.java:1570) Caused by: java.util.concurrent.ExecutionException: software.amazon.awssdk.crt.mqtt.MqttException: TLS (SSL) negotiation failed at java.util.concurrent.CompletableFuture.reportGet (CompletableFuture.java:396) at java.util.concurrent.CompletableFuture.get (CompletableFuture.java:2073) at pubsub.PubSub.main (PubSub.java:97) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293) at java.lang.Thread.run (Thread.java:1570) Caused by: software.amazon.awssdk.crt.mqtt.MqttException: TLS (SSL) negotiation failed at software.amazon.awssdk.crt.mqtt.MqttClientConnection.onConnectionComplete (MqttClientConnection.java:225) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.780 s [INFO] Finished at: 2024-06-26T16:04:09+05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project BasicPubSub: An exception occured while executing the Java class. null: InvocationTargetException: Exception occurred during connect: software.amazon.awssdk.crt.mqtt.MqttException: TLS (SSL) negotiation failed -> [Help 1]

asked 4 months ago279 views
1 Answer
0

Make sure that the certificates you are using are ok for AWS IOT Core and still valid. Keep port 8883 on TLSv1.2 always free from firewalls.

profile picture
EXPERT
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions