Found the solution:
I am using Mendix Service Console to host the app on a server.
The custom app settings can be configured in:
Project tab > Configuration > Advanced > Custom settings table
I added the DatabaseUseSsl: False and it worked.
In Settings.yaml file, this key-value parameter is added under the Runtime section
Runtime:
...
DatabaseUseSsl: false