Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into pkcs12_sample
  • Loading branch information
xiazhvera committed Aug 8, 2023
2 parents 7df1496 + e065cff commit 95b1340
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 15 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/handle-stale-discussions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: HandleStaleDiscussions
on:
schedule:
- cron: '0 */4 * * *'
discussion_comment:
types: [created]

jobs:
handle-stale-discussions:
name: Handle stale discussions
runs-on: ubuntu-latest
permissions:
discussions: write
steps:
- name: Stale discussions action
uses: aws-github-ops/handle-stale-discussions@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ to C++ by the [aws-crt-cpp](https://github.com/awslabs/aws-crt-cpp) package.

__Jump To:__

* [Installation](#Installation)
* [Installation](#installation)
* [Samples](./samples)
* [Getting Help](#Getting-Help)
* [Getting Help](#getting-help)
* [FAQ](./documents/FAQ.md)
* [Giving Feedback and Contributions](#Giving-Feedback-and-Contributions)
* [Giving Feedback and Contributions](#giving-feedback-and-contributions)
* [MQTT5 User Guide](./documents/MQTT5_Userguide.md)
* [Secure Tunnel User Guide](./documents/Secure_Tunnel_Userguide.md)

Expand Down Expand Up @@ -143,4 +143,4 @@ We need your help in making this SDK great. Please participate in the community

This library is licensed under the [Apache 2.0 License](./documents/LICENSE).

Latest released version: v1.25.0
Latest released version: v1.26.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.0
1.26.0
29 changes: 23 additions & 6 deletions documents/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Frequently Asked Questions

*__Jump To:__*
* [Where should I start](#where-should-i-start)
* [How do I enable logging](#how-do-i-enable-logging)
* [I keep getting AWS_ERROR_MQTT_UNEXPECTED_HANGUP](#i-keep-getting-aws_error_mqtt_unexpected_hangup)
* [Dependencies are bad](#dependencies-are-bad)
* [Detecting connection loss (tldr use keepAliveTimeSecs and pingTimeoutMs)](#connection-loss)
* [How to use a Pre-Built aws-crt-cpp (Most useful for development of this package)](#prebuilt-aws-crt-cpp)
* [I am experiencing deadlocks](#i-am-experiencing-deadlocks)
* [Mac-Only TLS Behavior](#mac-only-tls-behavior)
* [How do debug in VSCode?](#how-do-debug-in-vscode)
* [What certificates do I need?](#what-certificates-do-i-need)
* [I still have more questions about this sdk?](#i-still-have-more-questions-about-this-sdk)

### Where should I start?

If you are just getting started make sure you [install this sdk](https://github.com/aws/aws-iot-device-sdk-cpp-v2#installation) and then build and run the [basic PubSub](https://github.com/aws/aws-iot-device-sdk-cpp-v2/tree/main/samples#basic-mqtt-pub-sub)
Expand Down Expand Up @@ -48,15 +61,15 @@ If you have already downloaded this repository you can update the submodules wit
`git submodule update --init --recursive`


### Detecting connection loss (tldr use keepAliveTimeSecs and pingTimeoutMs)
### Detecting connection loss (tldr use keepAliveTimeSecs and pingTimeoutMs) <a name="connection-loss"></a>

There are 3 mechanisms for detecting connection loss:
1. The keepAliveTimeSecs and pingTimeoutMs arguments passed to MqttConnection::Connect(). These control how often the SDK sends a PINGREQ, and how long the SDK will wait for a PINGRESP before assuming the connection is lost. YOU SHOULD USE THIS TO RELIABLY DETECT CONNECTION LOSS.
2. If the OS socket says it's closed, the SDK immediately tries to reconnect. The timing of this is not reliable, it depends on the OS and how the connection is lost, it can take many minutes.
3. The various TcpKeepAlive controls on the MqttClientConnectionConfigBuilder. These control a similar mechanism at the TCP layer, rather than the MQTT layer, but is implemented in the OS and behavior may vary across platforms


### How to use a Pre-Built aws-crt-cpp (Most useful for development of this package)
### How to use a Pre-Built aws-crt-cpp (Most useful for development of this package) <a name="prebuilt-aws-crt-cpp"></a>

``` sh
mkdir aws-iot-device-sdk-cpp-v2-build
Expand All @@ -65,6 +78,10 @@ cmake -DCMAKE_INSTALL_PREFIX="<absolute path sdk-cpp-workspace dir>" -DCMAKE_PR
cmake --build . --target install
```

### I am experiencing deadlocks

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.

### Mac-Only TLS Behavior

Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.7.3, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
Expand All @@ -73,7 +90,7 @@ Please note that on Mac, once a private key is used with a certificate, that cer
static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.
```

### How do debug in VSCode?
### How do debug in VSCode?

Here is an example launch.json file to run the pubsub sample
``` json
Expand Down Expand Up @@ -111,14 +128,14 @@ Here is an example launch.json file to run the pubsub sample
* Device certificate
* Intermediate device certificate that is used to generate the key below
* When using samples it can look like this: `--cert abcde12345-certificate.pem.crt`
* Key files
* Key files
* You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you
* When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key`

### I still have more questions about the this sdk?
### I still have more questions about this sdk?

* [Here](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) are the AWS IoT Core docs for more details about IoT Core
* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass
* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass
* [Discussion](https://github.com/aws/aws-iot-device-sdk-cpp-v2/discussions) questions are also a great way to ask other questions about this sdk.
* [Open an issue](https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues) if you find a bug or have a feature request
* [Breif MQTT CONCEPT](./MQTT_CONCEPT.md)
Expand Down
4 changes: 2 additions & 2 deletions samples/secure_tunneling/secure_tunnel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Create a new secure tunnel in the AWS IoT console (https://console.aws.amazon.co
To run the sample with a destination access token in destination mode (default), you can use the following command:

``` sh
./secure_tunnel --signing_region <signing_region> --access_token_file <path to destination access token>
./secure-tunnel --signing_region <signing_region> --access_token_file <path to destination access token>
```

The sample will create a Secure Tunnel connection and remain connected in `DESTINATION MODE` and will echo any messages it receives through the Secure Tunnel back to the Source Device.
Expand All @@ -23,7 +23,7 @@ The sample will create a Secure Tunnel connection and remain connected in `DESTI
While the focus of the Secure Tunnel Client for the IoT Device SDK is to connect with Secure Tunnels in `DESTINATION MODE` we also support connecting in `SOURCE MODE`. The token file should be the Source Token in this instance and you must add the `--localProxyModeSource` flag:

``` sh
./secure_tunnel --signing_region <signing_region> --access_token_file <path to source access token> --localProxyModeSource
./secure-tunnel --signing_region <signing_region> --access_token_file <path to source access token> --localProxyModeSource
```

Then two samples will then connect to each other through the AWS Secure Tunnel endpoint and establish a stream through which data can be transmitted in either direction.
Expand Down

0 comments on commit 95b1340

Please sign in to comment.