-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[FR] Certificate based connecting to MQTT broker using TLS on ESP32 #5138
Comments
Just to be sure we're talking about the same.... Another still open issue is to validate the server certificate, to prevent man-in-the-middle attacks. |
What I'm trying to do is basically what I would do in script using the WifiClientSecure Library, For connecting with HiveMQ I would assign the Root CA server certificate in the esp32 and that would work. |
But a root CA server certificate is only needed to validate the server certificate. I thought you needed to have support for not (just) using username/password but also just allow to have some client certificate and/or client key. The current implementation as can be found in the latest builds (here) does not check the server certificate and just allows all presented certificates by the server (even self-signed ones). Have you checked if that allows you to connect to the MQTT broker of your choice? |
Hey @TD-er , Sorry for the late reply. edit: I also was not able to access the link you sent me, could you recheck please? |
What error do you get for the webflasher page? So if you try again and then tell me the timestamp, I can find it in the logs and remove your IP or IP-subnet from the block-list. |
Link works, thank. |
Excuse my technical knowledge here, I'm not sure how the connection gets authenticated by HiveMQ, but what I know is that I download the Root CA Server certificate and I would plug that into my script using the WifiClientSecure |
Right now, I do not actually use root CA certificates. Simply put, if you create a certificate for a domain, you typically generate a public/private key pair, create a certificate and sign it yourself with your private key. So to verify a full certificate chain, you have to do the reverse using the public key of the root CA and then verify that each of those certificates in your chain are signed by the keys they claim to have used. Since I have not yet added all these checks right now, there is no validation of those certificates and it is just assumed they are all who they claim they are and we just use accept the certificate and continue negotiating the connection. I do have 2 root CA's included in the code, among which is Let's encrypt and Google. (or maybe 3, have to check) Right now I don't know why your own test adding a root CA certificate makes it work, as it should only make sense to validate the server certificate. So as I understand it, you probably are also using some client certificate to login to HiveMQ, but this has not much to do with a root CA.... |
Maybe you should also set your controller timeout to the highest allowed value? |
I am trying to set up a secure MQTT connection with different brokers that require certificates like HiveMQ however this is not available in the current ESP-Easy build which only supports username and password authentication.
Since I'm working on the project that will be in an open network it is a good idea to use MQTTS to encrypt the messages I am sending while using ESP-Easy
The text was updated successfully, but these errors were encountered: