Repository navigation
fix: pass an explicit TLS version to the MQTT client - #1078
Merged
allenporter merged 1 commit intoNov 23, 2026
Merged
Conversation
paho-mqtt 2.1.0 reads ssl.PROTOCOL_TLSv1_2 when no TLS version is given. On a Python whose ssl module does not define that constant, the MQTT session failed to start with "module 'ssl' has no attribute 'PROTOCOL_TLSv1_2'". Pass ssl.PROTOCOL_TLS_CLIENT, which paho selected anyway, so certificate and hostname checks are unchanged.
allenporter
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Paho MQTT 2.1.0 reads
ssl.PROTOCOL_TLSv1_2when no TLS version is passed. On a Python build without that constant, the Roborock MQTT session fails during client setup.Changes
Pass
ssl.PROTOCOL_TLS_CLIENTexplicitly. The existing certificate verification setting is preserved.Testing
ssl.PROTOCOL_TLSv1_2in a local test process. With the explicit version, Paho created the TLS context with the expected certificate and hostname settings. This exercised client setup without connecting to a broker.321c6d5. The default suite excludes the 11 real-broker tests.