2

I have created a mobile application which uses secure MQTT (8883) for communication, however it looks like port 8883 is blocked by many ISP and networks. I had read some blogs which recommend using 443 in such cases, however I am not sure if that really would solve the issue. What are the disadvantages in changing the default Secure MQTT port (8883) to 443. Can someone share their feedback in using port 443 for MQTT ?

Note: I am using EMQ MQTT (emqtt) broker with Paho MQTT client.

4
  • As it stands this question is totally unanswerable. We have no idea what MQTT broker you are using or how you have actually configured it. Edit the question to include a LOT more detail
    – hardillb
    Commented Mar 31, 2019 at 18:47
  • @hardillb The question is not specific to any MQTT implementation (the implementation can change). Anyway I have added the details. Appreciate your valuable response.
    – Zac
    Commented Apr 1, 2019 at 7:03
  • How each broker is configured is totally different so any answer can only be in the context of that broker (also Stack Overflow questions need to be specific to be on topic). You still haven't included how you have currently configured emqtt (e.g. we need to know if you are using Native MQTT or MQTT over Websockets)
    – hardillb
    Commented Apr 1, 2019 at 7:36
  • @hardillb - 8883 is the default secure MQTT port. MQTT over Websocket is not in the question.
    – Zac
    Commented Apr 1, 2019 at 8:52

1 Answer 1

3

The list of recognised ports are there to help ensure that you can run multiple services in their default configuration on a machine without them clashing, as a rule they do not actually effect how the service runs.

With some very well used protocols (e.g. HTTP and HTTPS) network administrators may make assumptions about.

Just moving the port for native MQTT (with TLS) from 8883 to 443 to get round port blocking by networks(*) probably won't actually solve the problem. This is because the types of network that deploy these types of firewall settings also tend to conduct transparent proxying.

If you want a solution that will work even in the worst of cases then running MQTT over Secure Websockets (which is bootstrapped from HTTPS) is probably your best bet. Most of the Paho client library implementations (you don't say which you are using so can say for sure) support both native MQTT and MQTT over Websockets these days and can be given a list of broker URIs so once the broker is set up to support both you can try to connect via native MQTT then fall back to MQTT over Websockets if the connection fails.

2
  • Wouldn't MQTT over Secure Websockets (default Port in emqtt is 8084) also get blocked ? Or does it work over SSL port (443) itself ? Appreciate if you can explain how MQTT over secure websocket would work.
    – Zac
    Commented Apr 3, 2019 at 12:50
  • 1
    You'd run MQTT over Secure Websockets on port 443. Websocket based protocols should always be run on the normal HTTP/HTTPS ports for best compatibility with proxies/firewalls. (Just because emqtt has chosen 8084 doesn't mean you have to stick to it)
    – hardillb
    Commented Apr 3, 2019 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.