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
mosquitto_pub only Error: Problem setting TLS options. #1221
Comments
The only reasons for this error in this case can be "out of memory", or "can't open the cafile". I suspect the latter! I agree the message should be clearer. |
I don't believe either of them, unless it's doing something that is preventing it from being read by 2 processes at once (you can see both of my commands reference the same file). Would be good to try to figure out why it can't be read, permissions, no such file, bad format, etc. |
This commit gives some better hints when there is an error: cd8f12f |
Apologies, it could also be if the tls version string was wrong, or if the client had been compiled without TLS support - but it would have complained about an unknown option in the latter case. |
You could try removing |
It's still showing in the version mosquitto_pub version 1.6.4 running on libmosquitto 1.6.4. |
Can you provide more details? Are you on Mac as well? What does the exact command look like? |
I'm on Linux. I got it working now. I was using a wrong CA certificate. It's just that the message was not clear IMHO. |
That's worth sorting then. Is the error if you use |
I was using that. It was still the same. This is the full command I ran when I encountered the error message. |
What do you mean by wrong CA file? I am using rootCA.pem but it not working for me it giving error problem setting TLS options: File not found. |
Where did you get that |
"File not found" seems fairly clear :) You need the appropriate CA certificate for the server certificate of your server. Where to get it from depends on your own situation. If you made your own CA, you have the certificate. If you are using a commercial CA, then your OS may already have the CA cert. Try setting capath to /etc/SSL/certs instead of using cafile. |
Misspelled the --cafile parameter which led to Checking and reporting if the file does not exist would be helpful. |
@rngadam The error message in this situation is |
I had the same issue and was Google around and found this open issue.... lastly i notice it require sudo for unix, mine is ubuntu18 |
I had this issue when I inadvertently appended a space to the --cafile option placed in ~/.config/mosquito_pub. I only found out using strace. Maybe trailing space should be trimmed when reading options from this file |
For me it was because
I didn't look into why, but I assume it has to do with it being installed via Moving the certificate file to |
it works for me after run below command
|
first here's my subscriber, you can see that it works, using mqtt.fx to publish, and it's using the same ca_certificate.pem to publish
mosquitto_pub also works if I'm not using tls at all.
at the very least this error should be more detailed.
installed with
brew
on OS X.The text was updated successfully, but these errors were encountered: