TLS ERROR MQTT - Error in mqtt_connect: -111

Hello, 

I am trying to connect to the MQTT broker that uses a TLS certificate and user/password. I have set the user and password fields of these structs.

struct mqtt_utf8 pass, user_name;
Regarding the server certificate, I have tried the way that's described in the Cellular Fund course lesson 4.2 (Using certificate.h). Didn't work. Then I decided to manually write the certificate in security tag 24 using Certificate Manager, but I still got the same error.
Before anyone suspects it's the wrong certificate I have used the exact same one on Node-red and MQTT Explorer, it works there. 
I am using nRF9160-DK, modem firmware - mfw_nrf9160_1.3.5.
It just keeps returning -111 error upon trying to connect to the broker. I looked up and -111 is for ECONNREFUSED. That's why I suspect that maybe something is wrong with managing the certificate on nRF side.
Any help is much appreciated. 
Related