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

Add example for TLS connection #7

Open
stlehmann opened this issue May 22, 2017 · 4 comments
Open

Add example for TLS connection #7

stlehmann opened this issue May 22, 2017 · 4 comments

Comments

@stlehmann
Copy link
Owner

No description provided.

@henri-marais
Copy link

I've managed to configure the TLS version to connect to the message broker provided by Amazon Web Services. Connectivity to AWS checks out fine with openssl command line test, however the test application only reports sending CONNECT.

How can I determine the packet payload based on the debug output of sample application?
16 Sending CONNECT (u0, p0, wr0, wq0, wf0, c1, k60) client_id=b'simplewebapp'

@stlehmann
Copy link
Owner Author

Under the hood Flask-MQTT uses Paho-MQTT. Mqtt.client gives you a reference to the paho client. You can use this to analyze your packet payload.

@luuknnh
Copy link

luuknnh commented Jan 4, 2023

I can't get mine connected, if I set TLS on True it says [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version

@rubenhoenle
Copy link

rubenhoenle commented Aug 29, 2023

I can't get mine connected, if I set TLS on True it says [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version

Same here


Edit: This did the trick for me (I'm using a HiveMQ Cloud MQTT Broker).

from flask_mqtt import Mqtt, ssl

app.config['MQTT_TLS_ENABLED'] = True
app.config['MQTT_TLS_VERSION'] = ssl.PROTOCOL_TLSv1_2 # <---- SEE HERE

see https://github.com/stlehmann/Flask-MQTT/pull/117/files#diff-ab6c33fcbdc57dd3f74676467ec075a309f7e8c8dc97a80150cf069e9034d18bR38

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

No branches or pull requests

4 participants