How to connect to MQTT broker with TLS?
You could make the following changes to your code by making use of WifiClientSecure (which is already part of the ESP8266 Wifi library).

The tricky part is finding out the SHA1 fingerprint for your own MQTT server and hard coding it into the *fingerprint PROGMEM = "..."  part (for example by examining the certificate via a PC browser and copying the SHA1 fingerprint).

Alternatively, you could set the connection to setInsecure. This means that the connection will be encrypted but it will accept any server certificate without checking.

...
const char* mqttPassword = "pass";

WiFiClientSecure espClient;     // &lt;-- Change #1: Secure connection to MQTT Server 
PubSubClient client(espClient);

// Change #2: Set the SHA1 fingerprint for the connection --&gt;
static const char *fingerprint PROGMEM = "44 14 9A 3F C3 E9 F1 F3 84 1A B4 9F B6 4D 19 8A B2 92 31 D6";
...
...
void setup() {
    ...
    setup_wifi();

    espClient.setFingerprint(fingerprint);   // &lt;-- Change #3: Set the SHA1 fingerprint
    // Alternative: espClient.setInsecure;

    client.setServer(mqtt_server, 8883);  // &lt;-- Change #4: Set the port number to 8883
    client.setCallback(callback);
 ...


Good luck!