Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions documents/MQTT5_Userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls)
* [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication)
* [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication)
* [Direct MQTT with PKCS11](#direct-mqtt-with-pkcs11-method)
* [Direct MQTT with PKCS12](#direct-mqtt-with-pkcs12-method)
* [Direct MQTT with PKCS11 (Unix Only)](#direct-mqtt-with-pkcs11-method-unix-only)
* [Direct MQTT with PKCS12 (macOS Only)](#direct-mqtt-with-pkcs12-method-macos-only)
* [Direct MQTT with Windows Certificate Store Method](#direct-mqtt-with-windows-certificate-store-method)
* [HTTP Proxy](#http-proxy)
* [Browser](#browser)
Expand Down Expand Up @@ -263,7 +263,7 @@ token-signing fields to the value of the username that you assign within the cus
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.

#### Direct MQTT with PKCS11 Method
#### Direct MQTT with PKCS11 Method (Unix Only)

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:

Expand All @@ -286,7 +286,7 @@ A MQTT5 direct connection can be made using a PKCS11 device rather than using a

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

#### Direct MQTT with PKCS12 Method
#### Direct MQTT with PKCS12 Method (macOS only)

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:

Expand Down
3 changes: 2 additions & 1 deletion samples/browser/pub_sub_mqtt5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
)

builder.withConnectProperties({
clientId: "test-" + Math.floor(Math.random() * 100000000)
clientId: "test-" + Math.floor(Math.random() * 100000000),
keepAliveIntervalSeconds: 1200
});

let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
Expand Down
9 changes: 5 additions & 4 deletions samples/browser/react_sample/src/PubSub5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
let builder: iot.AwsIotMqtt5ClientConfigBuilder = iot.AwsIotMqtt5ClientConfigBuilder.newWebsocketMqttBuilderWithSigv4Auth(
AWS_IOT_ENDPOINT,
wsConfig
)
);
builder.withConnectProperties({
clientId: "test-" + Math.floor(Math.random() * 100000000)
clientId: "test-" + Math.floor(Math.random() * 100000000),
keepAliveIntervalSeconds: 1200
});

let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
Expand Down Expand Up @@ -189,12 +190,12 @@ function Mqtt5() {
async function PublishMessage()
{
const msg = `BUTTON CLICKED {${user_msg_count}}`;
const publishResult = await client.publish({
await client.publish({
qos: mqtt5.QoS.AtLeastOnce,
topicName: qos1Topic,
payload: msg
})
.then (() =>
.then ((publishResult) =>
{
log('Button Clicked, Publish result: ' + JSON.stringify(publishResult));
})
Expand Down
3 changes: 2 additions & 1 deletion samples/browser/react_sample/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
fallback:
{
"url": require.resolve("url/"),
"util": require.resolve("util/")
"util": require.resolve("util/"),
"events": require.resolve("events/")
}
},
module: {
Expand Down
7 changes: 6 additions & 1 deletion samples/node/mqtt/mqtt5_aws_websocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ Note that in a real application, you may want to avoid the use of wildcards in y

</details>

### Determining your signing region

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.
For example, if your endpoint is `abcdef12345-ats.iot.us-west-2.amazonaws.com`, the signing region is `us-west-2`.

## How to run

To Run this sample from the `samples/node/mqtt/aws_websocket` folder, use the following command:
To Run this sample from the `samples/node/mqtt/mqtt5_aws_websocket` folder, use the following command:

```sh
npm install
Expand Down
Loading