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
*[I am experiencing deadlocks](#i-am-experiencing-deadlocks)
9
-
*[How do debug in VSCode?](#how-do-debug-in-vscode)
9
+
*[How to debug in VSCode?](#how-to-debug-in-vscode)
10
10
*[What certificates do I need?](#what-certificates-do-i-need)
11
+
*[I am getting AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND](#root-ca-file)
11
12
*[How do I build and use the Android SDK?](#how-do-i-build-and-use-the-android-sdk)
12
13
*[Where can I find MQTT 311 Samples?](#where-can-i-find-mqtt-311-samples)
14
+
*[How can I improve the library size?](#how-can-i-improve-the-library-size)
13
15
*[I still have more questions about this sdk?](#i-still-have-more-questions-about-this-sdk)
14
-
*[How can I improve the library size? ](#how-can-i-improve-the-library-size)
15
16
16
17
### Where should I start?
17
18
@@ -36,7 +37,7 @@ To enable logging in the samples, you will need to set the following system prop
36
37
For example, to run `BasicPubSub` with logging you could use the following:
37
38
38
39
```sh
39
-
mvn compile exec:java -pl samples/Mqtt/Mqtt5X509 -Daws.crt.debugnative=true -Daws.crt.log.level=Debug -Daws.crt.log.destination=Stdout -Dexec.mainClass=pubsub.PubSub -Dexec.args='--endpoint <endpoint> --cert <path to cert> --key <path to key>'
40
+
mvn compile exec:java -pl samples/Mqtt/Mqtt5X509 -Daws.crt.debugnative=true -Daws.crt.log.level=Debug -Daws.crt.log.destination=Stdout -Dexec.args='--endpoint <endpoint> --cert <path to cert> --key <path to key>'
40
41
```
41
42
42
43
You can also enable [CloudWatch logging](https://docs.aws.amazon.com/iot/latest/developerguide/cloud-watch-logs.html) for IoT which will provide you with additional information that is not available on the client side sdk.
@@ -79,9 +80,9 @@ After getting it working make sure to only allow the actions and resources that
79
80
80
81
You MUST NOT perform blocking operations on any callback, or you will cause a deadlock. For example: in the on_publish_received callback, do not send a publish, and then wait for the future to complete within the callback. The Client cannot do work until your callback returns, so the thread will be stuck.
81
82
82
-
### How do debug in VSCode?
83
+
### How to debug in VSCode?
83
84
84
-
Here is an example launch.json file to run the pubsub sample
85
+
Here is an example `launch.json` file to run the X509 sample
85
86
```json
86
87
{
87
88
// Use IntelliSense to learn about possible attributes.
@@ -96,6 +97,7 @@ Here is an example launch.json file to run the pubsub sample
96
97
"mainClass": "mqtt5x509.Mqtt5X509",
97
98
"projectName": "Mqtt5X509",
98
99
"args": "--endpoint <account-number>-ats.iot.<region>.amazonaws.com --cert <path to cert> --key <path to key> --client-id test-client",
@@ -107,17 +109,29 @@ Here is an example launch.json file to run the pubsub sample
107
109
* You can download pre-generated certificates from the AWS console (this is the simplest and is recommended for testing)
108
110
* You can also generate your own certificates to fit your specific use case. You can find documentation for that [here](https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html) and [here](https://iot-device-management.workshop.aws/en/provisioning-options.html)
109
111
* Certificates that you will need to run the samples
110
-
* Root CA Certificates
111
-
* Download the root CA certificate file that corresponds to the type of data endpoint and cipher suite you're using (You most likely want Amazon Root CA 1)
112
-
* Generated and provided by Amazon. You can download it [here](https://www.amazontrust.com/repository/) or download it when getting the other certificates from the AWS console
113
-
* When using samples it can look like this: `--ca_file root-CA.crt`
114
112
* Device certificate
115
113
* Intermediate device certificate that is used to generate the key below
116
114
* When using samples it can look like this: `--cert abcde12345-certificate.pem.crt`
117
115
* Key files
118
116
* You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you
119
117
* When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key`
120
118
119
+
### I am getting AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND<aname="root-ca-file"></a>
120
+
121
+
This error usually occurs when the SDK cannot find or access the system's default trust store for TLS certificate validation. You can resolve this by downloading and specifying the Root CA certificate explicitly.
122
+
123
+
**Root CA Certificate**
124
+
* Download the root CA certificate file that corresponds to the type of data endpoint and cipher suite you're using (you most likely want Amazon Root CA 1 if you are using the AWS IoT service)
125
+
* This certificate is generated and provided by Amazon. You can download it [here](https://www.amazontrust.com/repository/) or download it when getting the other certificates from the AWS Console
126
+
127
+
**Set Root CA for the client builder**
128
+
```java
129
+
// When building your MQTT5 client, specify the CA file
130
+
// Mqtt5ClientBuilder builder = <setup your client builder based on your auth type>
131
+
builder.withCertificateAuthorityFromPath(null, "<path to AmazonRootCA1.pem>");
132
+
```
133
+
134
+
121
135
### How do I build and use the Android SDK?
122
136
Instructions for building, installing, and use of the Android SDK can be found [here](../documents/ANDROID.md)
0 commit comments