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

Protocol: renew device certificate if it is not valid #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Annopaolo
Copy link
Collaborator

@Annopaolo Annopaolo commented Aug 17, 2022

The device certificate was obtained only once, during the first connection. However, certificates may change over time
(e.g. by substituting an expired one with a valid one). Obtain a new certificate if the old one is not valid anymore.

As paho mqtt client does not expose TLS errors upon reconnection, a custom open connection function was added.

See #11.

@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #53 (b030a5e) into master (c4ca29b) will decrease coverage by 0.33%.
The diff coverage is 30.35%.

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   39.98%   39.65%   -0.34%     
==========================================
  Files           7        7              
  Lines        1158     1203      +45     
==========================================
+ Hits          463      477      +14     
- Misses        592      623      +31     
  Partials      103      103              
Impacted Files Coverage Δ
device/protocol_mqtt_v1.go 42.82% <26.41%> (-2.15%) ⬇️
device/device.go 47.09% <100.00%> (+3.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

The device certificate was obtained only once, during the first connection. However, certificates may change over time
(e.g. by substituting an expired one with a valid one). Obtain a new certificate if the old one is not valid anymore.

As paho mqtt client does not expose TLS errors upon reconnection, a custom open connection function was added.

Signed-off-by: Arnaldo Cesco <[email protected]>
Remove always-nil error from initializeMqttClient function signature

Signed-off-by: Arnaldo Cesco <[email protected]>
@Annopaolo Annopaolo added the enhancement New feature or request label Aug 24, 2022
@Annopaolo Annopaolo marked this pull request as ready for review August 24, 2022 14:46
@Annopaolo Annopaolo requested a review from rbino August 25, 2022 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants