-
Notifications
You must be signed in to change notification settings - Fork 51
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
Using adafruit_minimqtt with default networking #219
Comments
As far as I know, there isn't a way to not check the certificate chain. Can you run it off of the non-ssl port instead? |
I would definitely prefer to not do that, but it will be my fallback position. I wonder if there's a way for me to shim 'ssl' to make it skip the check. Actually, I don't even know that verifying the chain is the problem. The error is "sslv3 alert bad certificate" - I'm not sure what certificate it means when that error is coming from the server side. The server is the thing providing the certificate, and the certificate is acceptable to normal paho mqtt clients. It's as if minimqtt is trying to send a certificate to the broker even though I didn't tell it to do so. |
@wz2b what device are you using, and what version of CP? And if you remove the |
Are you using a self-signed certificate? If so, are you doing something like this? pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
cert = open("certificate.pem").read()
ssl_context.load_verify_locations(cadata=cert) |
@wz2b Could you open an issue on https://github.com/adafruit/circuitpython saying what you would like? |
I'm doing this on an m5stacks dial, with CircuitPython 9.1.0-beta.2. The dial is really a stamp s3 though. I will try loading an incommon intermediate/root and see what happens, but my sense is that's not really the problem. |
Sure. I'm not 100% sure where the problem is, but it seems like it's one of these two projects. I'm leaning toward it being minimqtt rather than circuitpython, because I was able to modify umqtt.simple to work with circuitpython's idea of socketpools and ssl. It doesn't work out of the box because the socket api is different (send vs write, recv vs. recv_into) but with just a few tweaks it connects to the exact same server as above.
|
My udnerstanding was that you were running a local mosquitto server that is providing https. But did you set up that server with its own self-signed cert? Or do you have some root or root-based intermediate cert that is the server cert? Re issue: sorry, I meant opening an issue not about the problem but about new networking features you would like, such as suppressing cert authentication. |
Does it work in radio = adafruit_connection_manager.CPythonNetwork()
pool = adafruit_connection_manager.get_radio_socketpool(radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(radio)
... |
I am trying to use adafruit_minimqtt with the default circuitpython socket implementation, like this:
On connect, my MQTT broker sees this:
I'm not quite sure why. It works okay with a version of umqtt that I modified to work with socketpool. For what I'm doing here I really don't want it checking the certificate chain (I'm not sure how to disable that) but even so, the error message above looks like something else, like it's trying to use certificate (rather than username/password) client authentication.
Am I missing some constructor parameters?
The text was updated successfully, but these errors were encountered: