Skip to content
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

publish single with TLS ca_certs from server #518

Closed
IsmaeelHaider opened this issue Oct 1, 2020 · 4 comments
Closed

publish single with TLS ca_certs from server #518

IsmaeelHaider opened this issue Oct 1, 2020 · 4 comments

Comments

@IsmaeelHaider
Copy link

IsmaeelHaider commented Oct 1, 2020

Hi,
I'm trying to connect to "mqtts://broker.emqx.io:8883" using paho mqtt but getting the invalid certificate error.
tls = { 'ca_certs': "certificate.pem", 'insecure': False, 'tls_version': ssl.PROTOCOL_TLS_CLIENT }
publish.single( topic="testtopic\", payload=payload, hostname="broker.emqx.io", auth={}, port=8883, tls=tls, protocol=mqtt.MQTTv311 )

I don't want it to be insecure and want to get the certificate from the server instead of providing a certificate file manually. It would be a great help if someone could guide me in a right direction.

@runout-at
Copy link

following works at least under debian: tls={'ca_certs':"/etc/ssl/certs/ca-certificates.crt"}

but i think ca_certs should be auto-detected from the system if not provided.

the documentation should have some useful examples for ca_certs

@MattBrittan
Copy link
Contributor

Closing this due to inactivity.

Unfortunately answering certificate related issues like this can be difficult without a reproducible example (often the issue is the certificate itself).

@runout-at
Copy link

@MattBrittan I wonder why you are closing this without asking for more information if something is not clear.

In my opinion the examples are there.

And as i found out it's just a missing default for the ca_certs file. At least on a debian stable (bookworm) system this is reproducible.

@MattBrittan
Copy link
Contributor

@runout-at there were around 300 open issues dating back many years; many of which had no responses at all. I'm attempting to get things into a manageable state so that issues can be categorised/resolved in a reasonable time-frame (as things stand the issue backlog is very intimidating, so has been largely ignored; resources are very limited). As you can probably understand working through this number of issues takes a considerable amount of time, and I will make mistakes (and am deliberately being somewhat ruthlessness through necessity).

In this case the issue was really a request for help, and as it was raised over three years ago closing it seemed the best approach (I probably should have added a "please reopen this if you are still experiencing the issue" as I have to many others). In addition, the issue you mention appears to differ from the OP's (they specified 'ca_certs': "certificate.pem").

And as i found out it's just a missing default for the ca_certs file. At least on a debian stable (bookworm) system this is reproducible.

Please consider raising this as a new issue (the docs state that "By default, on Python 2.7.9+ or 3.4+, the default certification authority of the system is used." so if that's not working then it's possibly a bug or deficiency in the docs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants