Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT connection without TLS #612

Closed
2 tasks done
karthikkumarb opened this issue Aug 9, 2023 · 7 comments
Closed
2 tasks done

MQTT connection without TLS #612

karthikkumarb opened this issue Aug 9, 2023 · 7 comments
Labels
feature-request A feature should be added or improved.

Comments

@karthikkumarb
Copy link

Describe the feature

I am looking for a sample code to connect to MQTT broker without TLS, Similar to plaintext sample code in aws-iot-device-sdk-embedded-C and a command line if any to connect to the broker.

Use Case

In our project, we need to support both TLS and non TLS connections.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

v1.27.0

Environment details (OS name and version, etc.)

Linux

@karthikkumarb karthikkumarb added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 9, 2023
@bretambrose
Copy link
Contributor

If you're not using TLS you can't use the builder interface for connection creation and instead need to directly use the types in the CRT. MQTT over plaintext just means you don't specify any TLS context.

If you're using MQTT311, use the API that does not take a TLS context: https://github.com/awslabs/aws-crt-cpp/blob/main/include/aws/crt/mqtt/MqttClient.h#L616-L631

If you're using MQTT5, don't set any tls configuration when building the client configuration: https://github.com/awslabs/aws-crt-cpp/blob/main/include/aws/crt/mqtt/Mqtt5Client.h#L441-L448

@bretambrose bretambrose removed the needs-triage This issue or PR still needs to be triaged. label Aug 9, 2023
@karthikkumarb
Copy link
Author

Hi @bretambrose, Can you please share a sample code if you have any? That will be useful for my reference.

@bretambrose
Copy link
Contributor

bretambrose commented Aug 9, 2023

There are no complete samples, but the integration tests in aws-crt-cpp show multiple examples: https://github.com/awslabs/aws-crt-cpp/blob/main/tests/MqttClientTest.cpp

@karthikkumarb
Copy link
Author

Hi @bretambrose, Does this has any examples to connect to the broker using JWT?

@bretambrose
Copy link
Contributor

No. There is no support for anything JWT related.

@sbSteveK
Copy link
Contributor

This issue appears to be resolved. Please feel free to comment and reopen if there are any further questions. Please open a new discussion or issue if further questions do not have to do with MQTT connection without TLS.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants