-
Notifications
You must be signed in to change notification settings - Fork 639
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
Updates for #1829 #1873
Updates for #1829 #1873
Conversation
#include <MQTTClient.h> | ||
#ifdef MQTT_MAX_PACKET_SIZE | ||
#if MQTT_LIBRARY == MQTT_LIBRARY_ARDUINOMQTT | ||
#ifdef MQTT_MAX_PACKET_SIZE | ||
MQTTClient _mqtt(MQTT_MAX_PACKET_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what is up with this btw. Does platformio build_flags need comment / bigger value for it? idk if json works at all with the default MQTT_MAX_PACKET_SIZE=400
Obviously, httpupdate should use this method. Later merge of ESPAsyncTCP with proper bssl support would not need anything with before/after logic, only thing what would be required is to have some kind object with the same API as WiFiClientSecureBearSSL (setTrustAnchors, setBufferSizes etc.) that would be somehow exposed on the target client. Template magic will properly handle the rest |
Very nice work :) I'll leave some comments on the code, but this looks good - I'll do some testing on my end as well. I agree the naming can be a bit better, for example |
Renamed those to |
#1829 (comment)
@Niek tested with https://test.mosquitto.org/ - test.mosquitto.org:8883, https://test.mosquitto.org/ssl/mosquitto.org.crt as custom .pem root
I also noticed that we may need to specify it clearer that it is not a client certificate, but root cert of the server.
_mqtt_client_ca
->_mqtt_client_server_ca
?And SecureClientHelpers do the rest. Since we want to have up-to-date config, allow module to define "config" struct with all of the settings as getters. "...scCheck" logic is separated in to internal "checks" struct, running all of the relevant actions based on "config" results.
AsyncMqttClient is still special case, because it handles fingerprinting all by itself. Difference from
dev
is that fingerprint only added on module setup, not with every configuration reload.Also notice a little optimization with onconnect verification for axtls. No need to overcomplicate things if it will be removed anyway.