I have set up a Mosquitto broker on Laptop A (10.2.30.23) listening on port 8883 with TLS enabled. The broker starts successfully and local publish/subscribe on Laptop A works fine.
Laptop A acts as:
MQTT Broker
MQTT Publisher
Laptop B (10.2.31.144) acts as:
MQTT Subscriber
Broker startup (Laptop A)
mosquitto -c ….\….\test.conf -v
Broker logs show:
Opening ipv4 listen socket on port 8883.
mosquitto running
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Additional details
ca.crt was generated on Laptop A and copied to Laptop B (same CA used)
No require_certificate true is configured on the broker
Broker works locally but is unreachable from the remote machine
Laptop A and Laptop B are on different subnets (10.2.30.x and 10.2.31.x)
Question
Is this issue likely caused by:
Windows firewall blocking inbound port 8883 on Laptop A?
Broker listener binding only to localhost?
Network/VLAN restrictions between subnets?
Any additional TLS or Mosquitto configuration required for remote clients?
Any guidance on what to validate next would be helpful.
The problem should not come from the TLS layer. All other options you have mentioned can likely be the cause of the problem. In your config file, what are your listener settings there? In theory, it is possible to only allow localhost connections. Could you check that?
8883, 0.0.0.0:8883 or 10.2.30.23:8883 → good, broker is reachable on the LAN.
127.0.0.1:8883 → bad, broker is local-only
Other than that, check your firewall settings and, if those ports are theoretically reachable, ping them from outside.
This does look fine. Have you checked whether your subscriber can reach the broker?
You can also check this in the broker logs and see if a connection comes through at the time of the sub.
If these are all the logs you are seeing, there is only one connection visible here to the broker. This means the other connection does not even reach it.
There is some network issue you will need to resolve to get the subscriber up and running.
This means no broker-level configuration should be the problem right now.
Hey @Tizian , so my configuration files and generation of certificates are all correct right ? What can be the network issue ? I have enabled the inbound and outbound rules for 8883 port for both the machines. And also tried with disabling the firewall on both the machines. Still no progress, I’m stuck as of now
Your certificates seem to be fine as it works on one connection and also you are not setting the require_certificate true option.
Have you tried checking the ports in the console?
Local check:
E.g. netstat -an | findstr :8883
Check from Other device: telnet <ip> 8883
As long as you are not spotting any logs referring to an incoming connection on the broker side from the external Laptop, you can be sure the broker is not blocking any connections. E.g., if the certificates were a problem, you would see TLS errors. You can also increase the log level to be sure to not miss any information with log_type all
This shows that the port is open, but you are not able to reach it from an external source.
Can you ping in general from Laptop A to B and other way around? ping <ip>
You will need to figure out the reason for those two not being able to communicate, either completely or only on that port. Unfortunately, there is not much more I can tell you. Make sure they are in the same network, check for other firewalls, maybe on router level, etc.