feat: add TLS support for MQTT datastore (#340)#441
Open
HrishikeshUchake wants to merge 1 commit intoteslamotors:mainfrom
Open
feat: add TLS support for MQTT datastore (#340)#441HrishikeshUchake wants to merge 1 commit intoteslamotors:mainfrom
HrishikeshUchake wants to merge 1 commit intoteslamotors:mainfrom
Conversation
- Added TLS configuration to MQTT producer - Updated config loader to support MQTT TLS fields - Added unit tests for MQTT TLS configuration - Updated README and examples with MQTT TLS configuration example
Author
|
Hi @patrickdemers6, @agbpatro, could you please review this? I'd love to hear your opinions and suggestions on this. Thank you so much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I have implemented the fix for issue [#340], which requested support and examples for connecting to an MQTT broker over SSL/TLS (e.g., port 8883).
Summary of Changes
TLS Configuration: Added a TLSConfig struct to the MQTT [Config] in [mqtt.go] to support enabled and ca (path to CA certificate) fields.
TLS Implementation: Updated [NewProducer] in [mqtt.go] to initialize a [tls.Config] when enabled. It now correctly loads the CA certificate from the specified path and applies it to the Paho MQTT client options.
Config Loading: Updated the configuration initialization tests in [config_initializer_test.go] and [test_configs_test.go] to ensure the new MQTT TLS fields are correctly parsed from JSON.
Unit Testing: Added comprehensive tests in [mqtt_test.go] to verify that TLS is correctly configured when enabled and that CA certificates are properly loaded.
Example Config: Updated [server_config.json] with a complete MQTT over SSL configuration example.
README Update: Added the new MQTT TLS configuration parameters to the [README.md] documentation
Fixes #340
Type of change
Please select all options that apply to this change:
Checklist:
Confirm you have completed the following steps: