# Mqtt\_server not connecting on port 8884

**URL:** <https://community.hivemq.com/t/mqtt-server-not-connecting-on-port-8884/1492>\
**Category:** HiveMQ Cloud\
**Created:** [September 29, 2022, 3:15pm UTC](https://community.hivemq.com/t/mqtt-server-not-connecting-on-port-8884/1492 "2022-09-29T15:15:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hassan](https://community.hivemq.com/u/Hassan)\
**Post date:** [September 29, 2022, 3:15pm UTC](https://community.hivemq.com/t/mqtt-server-not-connecting-on-port-8884/1492/1 "2022-09-29T15:15:47Z")

</div>

hello every one,  
hope so you all are fine.  
there is a problem I am facing that when I tried to connect server on port 8884 it gives me error Attempting MQTT connection…failed, rc = -4 try again in 5 seconds but the connection is successfully built on port 8883 I don’t understand the reason behind this kindly help me to to over come this problem .  
Thanks

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [September 30, 2022, 9:23am UTC](https://community.hivemq.com/t/mqtt-server-not-connecting-on-port-8884/1492/2 "2022-09-30T09:23:01Z")

</div>

HI @Hassan ,

In the HiveMQ Cloud cluster you have 2 interfaces:

| Port (TLS): | 8883 |
| --- | --- |
| Port (Websocket + TLS): | 8884 |

Authentication is with username and password. CA file (if needed) you can download from here: [link](https://community.hivemq.com/t/frequently-asked-questions/514).

We suggest using [MQTT CLI](https://hivemq.github.io/mqtt-cli/) as MQTT client. Then you can test as follows

```auto
mqtt publish --topic ${myTopic} --message ${myMessage} \
  --host ${hostname} --port 8884 --ws \
  --secure --debug \
  --username ${myUsername} --password ${myPassword}

```

Where

- option `--ws` tells the client to use WebSocket protocol,
- option `--secure` tells the client to use SSL,
- option `--debug` tells the client to output debug information to the stdout.

Or you can test as follows:

```auto
mqtt publish --topic ${myTopic} --message ${myMessage} \
  --host ${hostname} --port 8883 \
  --secure --debug \
  --username ${myUsername} --password ${myPassword}

```

Where

- option `--secure` tells the client to use SSL,
- option `--debug` tells the client to output debug information to the stdout.

I hope this helps,  
Dasha from HiveMQ team
