PIOT-GDA-10-001: Update MqttClientConnector to support simple authentication and encrypted connections to the broker #112
Labels
exercise
New feature to implement as an exercise
Milestone
Description
MqttClientConnector
so it can support loading and setting authorization value (user and password) as well as TLS encrypted connections to the broker.Review the README
Estimated effort may vary greatly
Actions
NOTE: The following actions are for your GDA's
MqttClientConnector
class.MqttClientConnector
:initCredentialConnectionParameters(String configSectionName)
as follows:NOTE: The
ConfigUtil
class provides a simplepublic Properties getCredentials(string configSectionName)
method that will attempt to load the file referenced by thecredFile
key in theconfigSectionName
of the loaded configuration file. This will store any key=value pairs within the file within the returnedProperties
instance until it is garbage collected. It's provided as a convenience method to allow a credential file to be stored separately from thePiotConfig.props
file.IMPORTANT! You should NEVER store secrets or credentials in a shared git repository or other storage medium without fully understanding the risks.
initSecureConnectionParameters(String configSectionName)
as follows:initClientParameters(String configSectionName)
. This update will also allow you to load your client ID from the configuration file.initClientParameters(String configSectionName)
method as follows:NOTE: For now, you don't need to change the configuration in PiotConfig.props - you can leave encryption disabled for the time being.
Estimate
Tests
MqttClientConnectorTest
test cases - no encryption is required for this, as it's only to verify that your code is still functioning properly.The text was updated successfully, but these errors were encountered: