# Cannot connect to Cloud HiveMQ using paho/python client

**URL:** <https://community.hivemq.com/t/cannot-connect-to-cloud-hivemq-using-paho-python-client/704>\
**Category:** HiveMQ Client Library\
**Created:** [September 1, 2021, 5:50am UTC](https://community.hivemq.com/t/cannot-connect-to-cloud-hivemq-using-paho-python-client/704 "2021-09-01T05:50:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![freshwuzhere](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/freshwuzhere/32/186_2.png) [@freshwuzhere](https://community.hivemq.com/u/freshwuzhere)\
**Post date:** [September 1, 2021, 5:50am UTC](https://community.hivemq.com/t/cannot-connect-to-cloud-hivemq-using-paho-python-client/704/1 "2021-09-01T05:50:53Z")

</div>

I have a free account and the CLI works perfectly from my machine.

When I run paho python client - with their example code (and now many iterations of their different examples) I cannot connect from the same machine as the CLI.

Logging for subscriber returns ==

Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client\_id=b’’  
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client\_id=b’’  
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client\_id=b’’

Logging for publisher returns ==  
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client\_id=b’’  
connack = 0  
Sending PUBLISH (d0, q0, r0, m987), ‘b’mytopic/test’’, … (37 bytes)  
Sending PUBLISH (d0, q0, r0, m988), ‘b’mytopic/test’’, … (3 bytes)  
publish mid: 987  
publish mid: 988  
Sending DISCONNECT

I have tried pretty much every combination of client ID and every other parameter…

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![hivemq-support](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/hivemq-support/32/357_2.png) [@hivemq-support](https://community.hivemq.com/u/hivemq-support)\
**Post date:** [September 1, 2021, 3:42pm UTC](https://community.hivemq.com/t/cannot-connect-to-cloud-hivemq-using-paho-python-client/704/2 "2021-09-01T15:42:51Z")

</div>

Hi @freshwuzhere,

Glad to see your interest in HiveMQ Cloud.  
We have a getting started section in HiveMQ Cloud. You can reach it from your console.

 ![Screenshot 2021-09-01 at 17.40.47](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/1X/666cc4b828cd36d3ab85e63f4dab9b729c5adcfe.png)  
It contains a guid for Paho Python.

Kind regards,  
Florian

---

<div class="post-metadata">

**Author:** ![freshwuzhere](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/freshwuzhere/32/186_2.png) [@freshwuzhere](https://community.hivemq.com/u/freshwuzhere)\
**Post date:** [September 1, 2021, 11:54pm UTC](https://community.hivemq.com/t/cannot-connect-to-cloud-hivemq-using-paho-python-client/704/3 "2021-09-01T23:54:24Z")

</div>

Thanks Florian!

As I anticipated the

client.tls\_set(tls\_version=mqtt.ssl.PROTOCOL\_TLS)

was missing and what I required.

Your help is much appreciated!
