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

feat(mqtt): Implement MQTT TLS encryption using certificates #102

Merged
merged 6 commits into from
Dec 28, 2023

Conversation

Slider0007
Copy link
Owner

@Slider0007 Slider0007 commented Dec 19, 2023

  • Implement TLS encryption for MQTT connection using certificates
    • Three certificate files are necessary on client side:
      • Certificate Authority (CA) certificate, e.g. ca.crt (unencyrpted, no password)
      • Client certificate, e.g. client.crt (unencrypted, no password)
      • Client provate key, client.key (unencrypted, no password)
    • Common certificate file extentions: *.crt, *.pem, *.der
    • Certificate files shall be copied to SD card folder /config/certs
    • 'certs' subfolder is generated automatically by firmware if missing
    • Certificate 'common name' (CN) check is disabled by default (hard-coded)
      mqtt_cfg.broker.verification.skip_cert_common_name_check = true
  • Add some additional error handling to indicate possible setup issues
  • Heap allocation in external SPIRAM to limit internal RAM usage
  • New parameter added in MQTT section (expert level)
    image

NOTE: A server/broker certificate implementation is mandatory to operate ESP with TLS encryption, refer to the MQTT broker manual and e.g. for certificate creation https://mosquitto.org/man/mosquitto-tls-7.html)


Feature ported from jomjol#2651

@Slider0007 Slider0007 changed the title feat(mqtt): Implement TLS encryption (certificate) feat(mqtt): Implement MQTT TLS encryption (certificate) Dec 19, 2023
@Slider0007 Slider0007 changed the title feat(mqtt): Implement MQTT TLS encryption (certificate) feat(mqtt): Implement MQTT TLS encryption using certificates Dec 19, 2023
@Slider0007 Slider0007 merged commit 7d53c1e into develop Dec 28, 2023
@Slider0007 Slider0007 deleted the mqtt-tls branch December 28, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants