Skip to content

Commit 0302f22

Browse files
committed
update cr comments
1 parent 208ea26 commit 0302f22

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

documents/FAQ.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
* [How do I get more information from an error code?](#how-do-i-get-more-information-from-an-error-code)
77
* [I keep getting AWS_ERROR_MQTT_UNEXPECTED_HANGUP](#i-keep-getting-aws_error_mqtt_unexpected_hangup)
88
* [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)
1010
* [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)
1112
* [How do I build and use the Android SDK?](#how-do-i-build-and-use-the-android-sdk)
1213
* [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)
1315
* [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)
1516

1617
### Where should I start?
1718

@@ -36,7 +37,7 @@ To enable logging in the samples, you will need to set the following system prop
3637
For example, to run `BasicPubSub` with logging you could use the following:
3738

3839
```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>'
4041
```
4142

4243
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
7980

8081
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.
8182

82-
### How do debug in VSCode?
83+
### How to debug in VSCode?
8384

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
8586
``` json
8687
{
8788
// Use IntelliSense to learn about possible attributes.
@@ -96,6 +97,7 @@ Here is an example launch.json file to run the pubsub sample
9697
"mainClass": "mqtt5x509.Mqtt5X509",
9798
"projectName": "Mqtt5X509",
9899
"args": "--endpoint <account-number>-ats.iot.<region>.amazonaws.com --cert <path to cert> --key <path to key> --client-id test-client",
100+
"vmArgs": "-Daws.crt.debugnative=true -Daws.crt.log.destination=Stdout",
99101
"console": "externalTerminal"
100102
}
101103
]
@@ -107,17 +109,29 @@ Here is an example launch.json file to run the pubsub sample
107109
* You can download pre-generated certificates from the AWS console (this is the simplest and is recommended for testing)
108110
* 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)
109111
* 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`
114112
* Device certificate
115113
* Intermediate device certificate that is used to generate the key below
116114
* When using samples it can look like this: `--cert abcde12345-certificate.pem.crt`
117115
* Key files
118116
* You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you
119117
* When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key`
120118

119+
### I am getting AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND<a name="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+
121135
### How do I build and use the Android SDK?
122136
Instructions for building, installing, and use of the Android SDK can be found [here](../documents/ANDROID.md)
123137

0 commit comments

Comments
 (0)