Skip to content
AdminKit

Is port 8883 (MQTT over TLS) exposed, and does encryption alone protect it?

AdminKit explains why TLS on port 8883 alone doesn't secure an MQTT broker: 8883 is MQTT's encrypted counterpart to plaintext port 1883, and while TLS protects data in transit, it says nothing about who may connect — a TLS-wrapped broker that still accepts anonymous connections is just as exposed as an unencrypted one once connected.

By AdminKit team, Netbase JSC · Updated

Key takeaways

  • Port 8883 is the IANA-registered port for MQTT over TLS. TLS hides the traffic from anyone on the path; it does not decide who may log in.
  • A broker on 8883 that accepts anonymous clients is open to anyone who completes a TLS handshake, and any client can do that unless the broker demands a client certificate.
  • The strongest setup on 8883 asks for a client certificate during the handshake and then a per-device identity, so a stranger never reaches the MQTT layer.
  • AdminKit’s port check shows whether 8883 answers on your own public IP. Its MQTT check speaks plaintext, so on a real TLS listener it reports “Could not complete a connection”; use the manual TLS checks below to finish the job.

What does TLS on port 8883 protect, and what does it leave open?

MQTT on port 8883 wraps the same publish-subscribe protocol that runs on 1883 in a TLS connection. The OASIS MQTT 5.0 standard notes that “TCP ports 8883 and 1883 are registered with IANA for MQTT TLS and non-TLS communication respectively”, and it treats transport encryption and client authentication as separate controls. Its security section describes layered profiles: a “clear communication” profile on an open network, a “secured network” profile behind a VPN, and a “secured transport” profile where TLS “provides authentication, integrity and privacy”. Even in that last profile, the username and password fields in CONNECT are a separate choice the broker makes.

That split is the whole story of an exposed 8883 port. TLS answers “can someone on the path read or change this traffic?”. Broker authentication answers “who is this client?”. A broker can have a valid certificate, a modern cipher suite, and still accept a CONNECT with no credentials at all.

Setup on port 8883Someone on the path reads trafficA stranger connects and subscribesA stranger reaches the MQTT parser
TLS, anonymous access onBlockedAllowedYes
TLS, username and password requiredBlockedRefused at CONNACKYes
TLS with required client certificate, plus per-device identityBlockedRefused at the TLS handshakeNo

The last row matters for exposure. With a required client certificate, an internet scanner without your CA’s signature never gets far enough to send an MQTT packet, so flaws in the broker’s MQTT code are out of its reach too.

Why does a broker on 8883 still accept strangers?

Usually because TLS was added to a broker that already allowed anonymous clients. Adding a listener with a certificate changes the transport, not the login rules. How the login rules default depends on the broker and its version. Eclipse Mosquitto is a useful example because its defaults changed. The Mosquitto 2.0 migration notes say that, with no configuration, 2.0 binds only to the loopback interfaces, and that allow_anonymous “now defaults to false”. Before 2.0, a configured listener allowed unauthenticated clients unless you said otherwise.

So two common paths lead to an anonymous 8883 listener. One is a configuration carried over from a 1.x install, where anonymous access was the working default and nobody revisited it during the upgrade. The other is an explicit allow_anonymous true, added during setup to get a device talking, which then applies to the new TLS listener as well. The mosquitto.conf reference also has per_listener_settings: when it is true, “authentication and access control settings will be controlled on a per-listener basis”, which makes it easy to lock down 1883 and leave 8883 open, or the reverse.

Other brokers and hubs have their own settings and defaults. Check the documentation for your exact version rather than assuming the TLS port inherits the plaintext port’s rules.

What can someone do once connected to an anonymous 8883 broker?

Exactly what they could do on an anonymous 1883 broker. The encryption only covers the trip between their machine and your broker. Once the session is up, they can subscribe to topics, receive retained state, and publish to command topics your devices obey. The port 1883 guide walks through those MQTT-level actions in detail, including how a stranger can knock a device offline by reusing its client ID. They apply unchanged on 8883.

The one difference is that the intruder’s own traffic is encrypted too. A network monitor that inspects plaintext MQTT on 1883 for unusual subscriptions sees only TLS records on 8883, so it can’t tell an intruder from a legitimate device. Logging on the broker itself (connects, client IDs, subscriptions) becomes the only place you can spot one.

Do your devices actually check the broker’s certificate?

TLS only protects credentials if the client verifies who it is talking to. The MQTT 5.0 standard says the protocol “is not trust symmetrical”: with basic authentication “there is no mechanism for the Client to authenticate the Server”, and TLS certificates sent by the server are how a client can do it. A device configured to accept any certificate will hand its username and password to whoever answers on 8883, including an attacker who has redirected its traffic.

When you review the clients that connect to an exposed 8883 broker, check three things in each one’s settings:

  1. A CA file or pinned certificate is configured. Without one, there is nothing to verify the broker against.
  2. Certificate verification is on. Many client libraries and tools have an “insecure” or “skip verification” switch for testing; it should be off in production.
  3. The hostname matches. The name the device connects to should appear in the broker certificate. The standard also points brokers that serve several hostnames from one IP address to the TLS Server Name Indication extension.

The same section warns that some valid TLS cipher suites “include a NULL encryption algorithm that does not encrypt data” and that clients and servers should avoid them. Mosquitto’s tls_version option sets the minimum TLS version per listener, with tlsv1.2 and tlsv1.3 as the accepted values.

How do you read AdminKit’s result for port 8883?

AdminKit’s open ports check runs a TCP connect test from AdminKit’s servers to the public IP you are browsing from, and to no other address. Port 8883 is one of the nine TCP ports it tests. The MQTT exposure check lets you enter 8883 as the port, sends one CONNECT with no credentials, and reads the CONNACK. It does that in plaintext, which shapes how its result reads on this port:

Tool and resultWhat it means for 8883Next step
Port check: “8883 (MQTT (TLS))” shows Open, with a high-severity “confirm client cert / auth is required” findingSomething accepts TCP connections on 8883 from the internetRun the TLS checks below to see what answers and whether it lets you in
Port check: Closed/filteredNo TCP connection completed within the check’s timeoutNot reachable from outside on this IP; re-check after router or firewall changes
MQTT check on port 8883: Could not complete a connectionExpected for a real TLS listener, since the check does not do the TLS handshakeNot a clean result; confirm with openssl and mosquitto_sub
MQTT check on port 8883: Anonymous access allowed, transport PlaintextPort 8883 is serving plaintext MQTT with no loginTwo problems: no TLS on the “TLS” port, and anonymous access. Fix both
MQTT check on port 8883: Authentication required, transport PlaintextA login is enforced, but the listener is not doing TLSCredentials cross the internet readable; turn TLS on for this listener

A plaintext answer on 8883 is worth catching. The port number is only a convention, and a listener line copied without its certificate options serves plain MQTT on whatever port you give it.

How do you confirm TLS and anonymous access yourself?

Run these from a connection outside your own network, such as a phone hotspot, against your own public IP (confirm it first with what is my IP). First see what TLS service answers, using openssl s_client. The output below is an illustrative, shortened example with a documentation address and name:

$ openssl s_client -connect 203.0.113.5:8883 -servername broker.example.com -brief </dev/null
CONNECTION ESTABLISHED
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN = broker.example.com
Verification: OK

If the handshake fails with an alert asking for a certificate, the broker requires client certificates, which is the strongest result. If it completes, test whether an anonymous client gets in. With the Mosquitto client tools, pass your CA file and no username:

mosquitto_sub -h broker.example.com -p 8883 --cafile ca.crt -t '$SYS/broker/version' -C 1 -W 5

A refusal such as “not authorised” means the broker requires credentials. A printed version string means an anonymous stranger can subscribe. On the broker host itself, ss -tlnp | grep 8883 shows which address the listener is bound to; 0.0.0.0 or [::] means every interface.

How do you lock port 8883 down?

If nothing outside your network needs the broker, remove the port forward and stop there. If remote clients do need it, require both a certificate and an identity. In Mosquitto, require_certificate means a client “must provide a valid certificate in order for the network connection to proceed”, and use_identity_as_username uses the certificate’s CN as the username, so your topic ACL can still treat each device separately. A minimal listener, with example paths:

per_listener_settings true

listener 8883
cafile   /etc/mosquitto/certs/ca.crt
certfile /etc/mosquitto/certs/broker.crt
keyfile  /etc/mosquitto/certs/broker.key
tls_version tlsv1.2
require_certificate true
use_identity_as_username true
allow_anonymous false
acl_file /etc/mosquitto/acl

Issue one certificate per device, so you can revoke a single lost device without re-keying the rest. Then re-run the outside checks above and confirm that a client without a certificate fails at the handshake.

For the broker-side steps beyond TLS (password files, interface binding, topic ACLs), see is port 1883 (MQTT) open on my router and the hardening guide it links to. If you would rather not run the broker yourself, Netbase sets up and runs the Secure MQTT Broker for you as a custom engagement, with per-device credentials and default-deny topic access.

Which brokers may you test with these checks?

Every check this page links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a network or device you don’t control — AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

If 8883 uses TLS, why would it still be a problem?

TLS encrypts the connection but doesn't by itself require a username or password — a broker can have a valid certificate and still accept anonymous connections, which is a common default aimed at easy first-time setup.

How do I know if my broker on 8883 actually requires authentication?

AdminKit's MQTT exposure check (/tools/mqtt-check/) reads the broker's response to an unauthenticated CONNECT on your own public IP, but it connects in plaintext: on 1883 it shows whether anonymous access is allowed, while a broker on 8883 that requires a TLS handshake first comes back as "Could not complete a connection" rather than confirmed. For the TLS port, use the openssl and mosquitto_sub checks on this page from outside your network.

Should I run 1883 or 8883 if I need remote access at all?

8883 (TLS), paired with authentication, not instead of it — plaintext 1883 should never carry credentials or sensitive topics across the open internet, and TLS alone on 8883 still needs authentication turned on to be meaningfully safer.

Does closing 1883 and only running 8883 fix the underlying issue?

No — if anonymous access is still enabled on the broker, moving to 8883 only stops someone from reading the connection in transit; they can still connect directly and read or publish to every topic.

Is a client certificate better than a username and password on 8883?

It closes the door earlier. With Mosquitto's require_certificate option, a client without a certificate signed by your CA fails the TLS handshake, so it never reaches the MQTT login at all. The MQTT 5.0 standard allows TLS client authentication in addition to, or in place of, the username and password fields.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.