-
Notifications
You must be signed in to change notification settings - Fork 638
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 rewrite with SSL fixes (see also: #1751) #1829
Conversation
- Added Arduino MQTT library support (actively maintained) - Added support for BearSSL (core >= 2.5) - BearSSL validation: insecure, fingerprinting and CA validation - AxTLS validation: insecure and fingerprinting - Support MFLN in order to reduce heap usage
Quick questions:
|
I'm using
I agree, it's getting quite messy for sure - I can split up in a separate WifiClient and AsyncMqttClient one if you want? It'll be a bit more verbose obviously and have some duplication, but the code will be more readable.
I think it makes sense, but if we want things like separate MFLN/CA/etc settings per module it will be hard to make it a common method. And there may be more exceptions: for example, we might always want to attempt MFLN on MQTT but not on OTA.
I don't understand this question, can you elaborate? When |
You can just use PSTR always. For any debug message it makes sense to place those there, since they will be kept in heap otherwise; after esp loads the binary, all char strings are placed in heap (unless specified
Duplication can be minimized through? At the very least, maybe some flow can be split up into functions. If marked as explicitly inline, binary code would be exactly the same, but (i hope) more readable.
When I get around to updating the HTTPupdate PR, I will try to implement sort of a wrapper for wificlient struct and helpers for some of the flow stages (i.e. here we are checking mfln, here we are setting up security checks). Some minimal config, giving cert pointer and fp string for example.
I meant changing |
I have cleaned up the code a bit, using PSTR everywhere and made the connect method a lot more concise (still not spit up though). Having the WiFiClient(Secure) wrapper would help a lot in cleaning up the code I think.
Ah yes, I probably should have put that in a separate PR - I assume that after introducing |
Web UI is still TBD as per comment #1829 (comment) |
Regarding my previous comment about the fixed flash location for cert data, this is exactly what happened in tasmota aws iot integration: |
Little follow up on client configuration, based on this branch. Gist of what's changed:
And SecureClientHelpers do the rest. Since we want to have up-to-date config, there's new "config" struct with all of the settings as getters. "...scCheck" logic is separated in to "checks" struct, running all of the relevant actions. Continuing off-topic about the certs... |
This PR kind of depends on #1751, might be better to wait for that one to be merged first. Update: #1751 is merged now.