-
Notifications
You must be signed in to change notification settings - Fork 1.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
CircuitPython TLS version in m5stack #9265
Comments
Could you try 9.1.0-beta.2 and see if there is any difference in behavior? Which TLS versions is your broker supporting? I am surprised, because I thought we supported at least TLSv1.2, if not also TLSv1.3 and we'd try the "best" one first. There are test hosts here for TLSv1.0, v1.1, and v1.2: https://badssl.com/. You can just try a connect or a request from those. |
Yes, I would be happy to try the latest version! My broker is set for tls
1.3 and later, I looked at mosquitto.conf yesterday - when I get back to my
office I will post an updated mosquitto.conf to confirm this, and I can try
beta.2.
…On Tue, May 21, 2024 at 12:14 PM Dan Halbert ***@***.***> wrote:
Could you try 9.1.0-beta.2 and see if there is any difference in behavior?
Which TLS versions is your broker supporting? I am surprised, because I
thought we supported at least TLSv1.2, if not also TLSv1.3 and we'd try the
"best" one first.
There are test hosts here for TLSv1.0, v1.1, and v1.2: https://badssl.com/.
You can just try a connect or a request from those.
—
Reply to this email directly, view it on GitHub
<#9265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALTMOPJS3WYCMQE5S5FAQTZDNXGVAVCNFSM6AAAAABIB4ELY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSHE4DAMZUGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Can you try setting it to v1.2? Is it v1.3 only? v1.3 may not be supported. |
Setting the broker to use v1.2 and even v1.1 still didn't work, but now I'm thinking maybe the TLS version isn't the issue:
I don't know. Mosquitto is pretty standard - it's probably the #1 MQTT broker used by people who use CircuitPython (I would imagine) so I'm mystified. Trying beta.2 now. |
The M5Dial has an M5Stamp inside, which is 8MB flash, but no PSRAM. We've seen problems with running out of memory on similar configurations when setting up HTTPS with your own certificates. Is the logging you're showing here from mosquitto? What is being printed on the REPL serial port in CircuitPython? If you could come up with a minimal example, that would be great. And show us the (readacted as needed) mosquitto config. |
Also update the libraries to the latest as of today. There have been changes even today that will not be in the bundle until tonight. |
Here's a really simple example:
Notice I commented out all the requirements on things like cipher suites to make things a little looser, just until we can figure this out. This is mosquitto 2.0.18 which is the most recent eclipse-mosquitto image in dockerhub. |
Just for the fun of it, I converted umqtt.simple to work with the socketpool, and got the same exact results:
|
It's odd that the SSL module doesn't support options like verify certificate (to false) and TLS version - is this to save code space? |
We are using mbedtls under the covers. It may or may not provide some of this functionality. We implemented a subset to cover most use cases. Additions are welcome via PR. |
I would love to but I feel like I'd be over my head when it comes to TLS .... |
Is this possibly related? https://forums.mbed.com/t/tls-version-number-in-a-client-hello-packet/4863 |
Looking at the compilations settings, the Espressif boards are compiled to support TLSv1.2. The link you posted above is not what the source code looks like any more. It enforces a minimum TLS version based on the compilation options. |
This is really stretching what I know about TLS but you're right. I wrote a small shim around circuitpython's socket class so I could inject some logging. The first thing it sends is:
Breakdown
This problem appears to be not what I think it is. I'm going to close this ticket. Sorry for the noise but thank you for helping me work through this. I'll leave this info here just in case someone else stumbles across a similar question in the future. |
No problem - I am looking at a number of things about the SSL implementation that I had not tried to understand in detail previously, in order to figure out why we're having other problems, such as memory issues. For instance, I did not know about the TLSv1.2 compilation option. |
If this helps, you can do this:
all it does is spits out the writes. For what I was doing (trying to see the TLS handshake, which is the very first thing it does) it was helpful. Mainly because I discovered that if you paste the hex to ChatGPT and tell it that it's a TLS negotiation, it will decode the whole thing for you.
|
I'm using circuitpython 9.0.4 on an m5stack dial and it works great, but I can't connect to my MQTT broker:
I would like to be able to:
but there is no .options
Is there any way to force TLS v1.2? If not, this is a feature request.
Adafruit CircuitPython 9.0.4 on 2024-04-16; M5Stack Dial with ESP32S3
The text was updated successfully, but these errors were encountered: