If you want to use TLS / port 8883 the following topic may provide some help:
Cannot connect to MQTT over the port 8883