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

Hard time getting TLS v1.2 to work #90

Open
sj3fk3 opened this issue Feb 23, 2021 · 3 comments
Open

Hard time getting TLS v1.2 to work #90

sj3fk3 opened this issue Feb 23, 2021 · 3 comments

Comments

@sj3fk3
Copy link

sj3fk3 commented Feb 23, 2021

to me it's unclear to what the configuration variable MQTT_TLS_VERSION should be set to. the documentations states:

Specifies the version of the SSL/TLS protocol to be used. By default TLS v1 is used. Previous versions (all versions beginning with SSL) are possible but not recommended due to possible security problems. Defaults to ssl.PROTOCOL_TLSv1.

Then in de code i see this:

Line 96: self.tls_version: int = ssl.PROTOCOL_TLSv1

So should it be a string or a int? and if int, what value should it be for TLSv.1.2

@sj3fk3
Copy link
Author

sj3fk3 commented Mar 2, 2021

I guess, it's 2, but I do think the documentation could be a little bit more clear. Also defaulting to TLSv1 might not be best idea since sliced bread.

@pikowai
Copy link

pikowai commented Jan 5, 2022

It's an integer defined in the ssl library i think, use ssl.PROTOCOL_TLSv1_2
to get v1.2

@Sohaib90
Copy link
Collaborator

Sohaib90 commented Aug 25, 2022

To use TLS v1.2 all you have to do is
app.config['MQTT_TLS_ENABLED'] = True
app.config['MQTT_TLS_VERSION'] = ssl.PROTOCOL_TLSv1_2
when configuring the mqtt parameters while setting up

importing ssl and using the ssl specified TLSv1.2 is the safe way to do it

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