I get a connection failure when I try to connect to my postgres server in Azure from my app/client, which does not have SSL enabled.
Unable to connect to server: FATAL: SSL connection is required. Please specify SSL options and retry.
Is this a strong requirement? Is there a way I can circumvent this requirement?
It helps me:
psql -v sslmode=true -h myapp.postgres.database.azure.com -U my_db_admin@myapp postgres
Rather than bypassing this error and simply disabling SSL, you might also want to try simply enabling SSL by pimping up your connection string:
Notice the
SslMode=Require
suffix at the end? This works with Npgsql as well (assuming you use C#) for connecting to an Azure Database for Postgresql.By default, Azure Database for PostgreSQL enforces SSL connections between your server and your client applications to protect against MITM (man in the middle) attacks. This is done to make the connection to your server as secure as possible.
Although not recommended, you have the option to disable requiring SSL for connecting to your server if your client application does not support SSL connectivity. Please check How to Configure SSL Connectivity for your Postgres server in Azure for more details. You can disable requiring SSL connections from either the portal or using CLI. Note that Azure does not recommend disabling requiring SSL connections when connecting to your server.
I've just changed my dependency from
to
runtimeOnly 'org.postgresql:postgresql'
inbuild.gradle
file. It was working fine.