Hello everyone, I am using a flask app to connect to my MQTT. However, I keep running into errors when configuring.

Here is my code for the configuration:

app.config[‘MQTT_BROKER_URL’] = “”
app.config[‘MQTT_BROKER_PORT’] = 8883
app.config[‘MQTT_TLS_ENABLED’] = True
app.config[‘MQTT_TLS_INSECURE’] = True
app.config[‘MQTT_TLS_CA_CERTS’] = “mqtt\python-mqtt\isrgrootx1.pem”
app.config[‘MQTT_TLS_KEYFILE’] = “mqtt\python-mqtt\private.key”

Error receieved:

ssl.SSLError: (‘No cipher can be selected.’,)

Anyone knows how to fix this? I am stucked at this problem for the past 9 hours :frowning:

Hi @whathellahor,

if the ERROR message is to be trusted your configured cipher suite “TLS_RSA_WITH_AES_256_CBC_SHA” is not in the acceptable list of the server. So as server and client don’t have a cipher suite in common the TLS handshake can’t be done.

This cipher suite should work as the server (HiveMQ cloud) selected it: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

Michael from the HiveMQ team