Skip to content

Commit

Permalink
Add Windows cert section in mqtt5 sample readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Feb 2, 2024
1 parent 84d434a commit 39ca114
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [Direct MQTT with Custom Authentication](./node/pub_sub_mqtt5/README.md#direct-mqtt-with-custom-authentication)
* [Direct MQTT with PKCS11](./node/pub_sub_mqtt5/README.md#direct-mqtt-with-pkcs11-method)
* [Direct MQTT with PKCS12](./node/pub_sub_mqtt5/README.md#direct-mqtt-with-pkcs12-method)
* [Direct MQTT with Windows Certificate Store Method](./node/pub_sub_mqtt5/README.md#direct-mqtt-with-windows-certificate-store-method)
* [Node: MQTT5 Pub/Sub with Electron](./node/pub_sub_electron_node/README.md)
* [Node: MQTT5 Shared Subscription](./node/shared_subscription/README.md)
* **Browser**
Expand Down Expand Up @@ -77,4 +78,4 @@ To:
"aws-iot-device-sdk-v2": "<latest released version eg: ^1.3.0>",
"yargs": "^14.0.0"
}
```
```
21 changes: 20 additions & 1 deletion samples/node/pub_sub_mqtt5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ possibilities.
* [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 Windows Certificate Store Method](#direct-mqtt-with-windows-certificate-store-method)
### HTTP Proxy
* [Adding an HTTP Proxy](#adding-an-http-proxy)

Expand Down Expand Up @@ -259,6 +260,24 @@ A MQTT5 direct connection can be made using a PKCS12 file rather than using a PE

Note: Currently, TLS integration with PKCS#12 is only available on MacOS devices.

#### Direct MQTT with Windows Certificate Store Method

A MQTT5 direct connection can be made with mutual TLS with the certificate and private key in the Windows certificate store,
rather than simply being files on disk. To create a MQTT5 builder configured for this connection, see the following code:

```typescript
// Certificate store path below is an example.
let certificateStorePath : string = "CurrentUser\\MY\\A11F8A9B5DF5B98BA3508FBCA575D09570E0D2C6";
sfod marked this conversation as resolved.
let builder = AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(
"<account-specific endpoint>",
certificateStorePath
);
let client : Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
```

Note: Windows Certificate Store connection support is only available on Windows devices.

### Adding An HTTP Proxy
No matter what your connection transport or authentication method is, you may connect through an HTTP proxy
by applying proxy configuration to the builder:
Expand All @@ -272,4 +291,4 @@ by applying proxy configuration to the builder:
```

SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional
proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example).
proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example).

0 comments on commit 39ca114

Please sign in to comment.