Skip to content

Commit fefa900

Browse files
committed
Improved MQTT5 user guide and sample documentation
1 parent cd5115c commit fefa900

3 files changed

Lines changed: 36 additions & 6 deletions

File tree

documents/MQTT5_Userguide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ For X509 based mutual TLS, you can create a client where the certificate and pri
8888
client = mqtt5_client_builder.mtls_from_path(
8989
endpoint = "<account-specific endpoint>",
9090
cert_filepath=cert_filepath,
91-
pri_key_filepath=pri_key_filepath))
91+
pri_key_filepath=pri_key_filepath)
9292
```
9393

9494
#### **Direct MQTT with Custom Authentication**
@@ -121,7 +121,7 @@ If your custom authorizer uses signing, you must specify the three signed token
121121

122122
In both cases, the builder will construct a final CONNECT packet username field value for you based on the values configured. Do not add the token-signing fields to the value of the username that you assign within the custom authentication config structure. Similarly, do not add any custom authentication related values to the username in the CONNECT configuration optionally attached to the client configuration. The builder will do everything for you.
123123

124-
#### **Direct MQTT with PKCS11 Method**
124+
#### **Direct MQTT with PKCS11 Method (Unix Only)**
125125

126126
An MQTT5 direct connection can be made using a PKCS11 device rather than using a PEM encoded private key, the private key for mutual TLS is stored on a PKCS#11 compatible smart card or Hardware Security Module (HSM). To create an MQTT5 builder configured for this connection, see the following code:
127127

@@ -144,7 +144,7 @@ An MQTT5 direct connection can be made using a PKCS11 device rather than using a
144144

145145
**Note**: Currently, TLS integration with PKCS#11 is only available on Unix devices.
146146

147-
#### **Direct MQTT with PKCS12 Method**
147+
#### **Direct MQTT with PKCS12 Method (MacOs Only)**
148148

149149
An MQTT5 direct connection can be made using a PKCS12 file rather than using a PEM encoded private key. To create an MQTT5 builder configured for this connection, see the following code:
150150

@@ -180,7 +180,7 @@ any additional configuration:
180180
client = mqtt5_client_builder.websockets_with_default_aws_signing(
181181
endpoint = "<account-specific endpoint>",
182182
region = signing_region,
183-
credentials_provider=credentials_provider))
183+
credentials_provider=credentials_provider)
184184
```
185185

186186
#### **MQTT over Websockets with Cognito authentication**
@@ -207,7 +207,7 @@ To create an MQTT5 builder configured for this connection, see the following cod
207207
client = mqtt5_client_builder.websockets_with_default_aws_signing(
208208
endpoint = "<account-specific endpoint>",
209209
region = signing_region,
210-
credentials_provider=credentials_provider))
210+
credentials_provider=credentials_provider)
211211
```
212212

213213
**Note**: A Cognito identity ID is different from a Cognito identity pool ID and trying to connect with a Cognito identity pool ID will not work. If you are unable to connect, make sure you are passing a Cognito identity ID rather than a Cognito identity pool ID.
@@ -239,7 +239,7 @@ by adding the http_proxy_options keyword argument to the builder:
239239
endpoint = "<account-specific endpoint>",
240240
cert_filepath = "<certificate file path>",
241241
pri_key_filepath = "<private key file path>",
242-
http_proxy_options = http_proxy_options))
242+
http_proxy_options = http_proxy_options)
243243
```
244244

245245
SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional

samples/mqtt/mqtt5_aws_websocket.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ Note that in a real application, you may want to avoid the use of wildcards in y
6464

6565
</details>
6666

67+
### Determining your signing region
68+
69+
The `signing_region` parameter specifies the AWS region used to sign WebSocket connection requests via [SigV4 authentication](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). It must match the region of your AWS IoT Core endpoint.
70+
For example, if your endpoint is `abcdef12345-ats.iot.us-west-2.amazonaws.com`, the signing region is `us-west-2`.
71+
6772
## How to run
6873

6974
To Run this sample from the `samples\mqtt` folder, use the following command:

samples/mqtt/mqtt5_x509.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,31 @@ Note that in a real application, you may want to avoid the use of wildcards in y
6666

6767
</details>
6868

69+
### Getting AWS IoT Endpoint
70+
Your AWS IoT endpoint is the address your devices use to connect to AWS IoT Core. You can retrieve it using either the AWS Console or the AWS CLI.
71+
72+
#### Using the AWS Console
73+
74+
1. Navigate to the [AWS IoT Core](https://console.aws.amazon.com/iot) console.
75+
2. In the left navigation pane, select **Domain configurations**.
76+
3. Copy the domain name listed — this is your AWS IoT endpoint.
77+
78+
#### Using the AWS CLI
79+
80+
Run the following command:
81+
82+
```sh
83+
aws iot describe-endpoint --endpoint-type iot:Data-ATS
84+
```
85+
86+
The output will contain your endpoint:
87+
88+
```json
89+
{
90+
"endpointAddress": "<AWS IoT endpoint>"
91+
}
92+
```
93+
6994
## How to run
7095

7196
To Run this sample from the `samples\mqtt` folder, use the following command:

0 commit comments

Comments
 (0)