Postgresql service with sslmode SSL off


I am trying to connect a postgresql db as a service. I can’t seem to get the sslmode option to work. I have tried adding it as an option and in the connection string.

The error I get is image

I have tried ssl and sslmode as the key. I have tried setting the value of sslmode to true, 1, TRUE, require, on and probably a few other things but it doesn’t seem to make any difference.

I found which states it should be a boolean. Has anyone done this that can give me some guidance?