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

mqtt ssl #3

Closed
copart opened this issue Jan 5, 2025 · 3 comments
Closed

mqtt ssl #3

copart opened this issue Jan 5, 2025 · 3 comments

Comments

@copart
Copy link

copart commented Jan 5, 2025

It appears that the mqtt will not work via ssl

Jan 04 22:54:56 REDACTED mosquitto[27688]: 1736049296: New connection from REDACTED on port 8883.
Jan 04 22:54:56 REDACTED mosquitto[27688]: 1736049296: OpenSSL Error[0]: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol
Jan 04 22:54:56 REDACTED mosquitto[27688]: 1736049296: Socket error on client , disconnecting.

This idea sounds really great!

@davidedmundson
Copy link
Owner

Can you try swapping in core.cpp

m_client->connectToHost()

to

QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration();
m_client ->connectToHostEncrypted(sslConfig);

and tell me if it works, if so we can add a flag in the config options.

if you need self-signed certificates, we'll need to add a line
I think sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);

but I'm not 100% sure.

@copart
Copy link
Author

copart commented Jan 5, 2025

this worked perfectly.

Jan 05 15:48:41 REDACTED mosquitto[27688]: 1736110121: Client connection from REDACTED failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol.
Jan 05 15:48:42 REDACTED mosquitto[27688]: 1736110122: New connection from REDACTED on port 8883.
Jan 05 15:48:42 REDACTED mosquitto[27688]: 1736110122: New client connected from REDACTED as 21d09615fe054b9b954d08a (p2, c1, k3, u'REDACTED').

The logs do show a failed HELLO... However, it proceeds to post the messages... I can interact with KDE from HomeAssistant as well!!

Thank you!

@davidedmundson
Copy link
Owner

merged. See new config option

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

2 participants