Skip to content

Commit bdad228

Browse files
committed
Update MQTT docs and code error
1 parent 335795a commit bdad228

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

documents/MQTT5_Userguide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
+ [How to setup a MQTT5 builder based on desired connection method](#how-to-setup-mqtt5-builder-based-on-desired-connection-method)
1010
* [Direct MQTT with X509-based Mutual TLS Method](#direct-mqtt-with-x509-based-mutual-tls-method)
1111
* [Direct MQTT with Custom Authorizer Method](#direct-mqtt-with-custom-authorizer-method)
12-
* [Direct MQTT with PKCS11 Method](#direct-mqtt-with-pkcs11-method)
13-
* [Direct MQTT with PKCS12 Method](#direct-mqtt-with-pkcs12-method)
12+
* [Direct MQTT with PKCS11 Method (Unix Only)](#direct-mqtt-with-pkcs11-method-unix-only)
13+
* [Direct MQTT with PKCS12 Method (macOS Only)](#direct-mqtt-with-pkcs12-method-macos-only)
1414
* [Direct MQTT with Custom Key Operations Method](#direct-mqtt-with-custom-key-operation-method)
1515
* [Direct MQTT with Windows Certificate Store Method](#direct-mqtt-with-windows-certificate-store-method)
1616
* [Direct MQTT with Java Keystore Method](#direct-mqtt-with-java-keystore-method)
@@ -147,14 +147,14 @@ AwsIotMqtt5ClientBuilder builder = AwsIotMqtt5ClientBuilder.newDirectMqttBuilder
147147

148148
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.
149149

150-
### **Direct MQTT with PKCS11 Method**
150+
### **Direct MQTT with PKCS11 Method (Unix Only)**
151151

152152
A 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 a MQTT5 builder configured for this connection, see the following code:
153153

154154
~~~ java
155155

156156
Pkcs11Lib pkcs11Lib = new Pkcs11Lib("<path to PKCS11 library>");
157-
TlsContextPkcs11Options pkcs11Options = new TlsContextPkcs11Options(pkcs11Lib)) {
157+
TlsContextPkcs11Options pkcs11Options = new TlsContextPkcs11Options(pkcs11Lib)
158158
pkcs11Options.withCertificateFilePath("<certificate file path>");
159159
pkcs11Options.withUserPin("<pkcs11 user pin>");
160160

@@ -182,7 +182,7 @@ AwsIotMqtt5ClientBuilder builder = AwsIotMqtt5ClientBuilder.newDirectMqttBuilder
182182

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

185-
### **Direct MQTT with PKCS12 Method**
185+
### **Direct MQTT with PKCS12 Method (macOS only)**
186186

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

samples/Mqtt/Mqtt5AwsWebsocket/README.md

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

6868
</details>
6969

70+
### Determining your signing region
71+
72+
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.
73+
For example, if your endpoint is `abcdef12345-ats.iot.us-west-2.amazonaws.com`, the signing region is `us-west-2`.
74+
75+
7076
## How to run
7177

7278
To run this sample from the `aws-iot-device-sdk-java-v2` folder use the following command:

samples/Mqtt/Mqtt5AwsWebsocket/src/main/java/awswebsocket/Mqtt5AwsWebsocket.java renamed to samples/Mqtt/Mqtt5AwsWebsocket/src/main/java/mqtt5awswebsocket/Mqtt5AwsWebsocket.java

File renamed without changes.

0 commit comments

Comments
 (0)