Error: The server does not support SSL connections - postgresql

M1 Mac Monterey12.1
Error: The server does not support SSL connections
I used a postgres server to
I ran the following code.
DATABASE_URL=$DATABASE_URL NODE_ENV=production yarn develop
I'm using strapi with a postgres server.
I did a breww install openssl.

The PostgreSQL server does not support SSL connections. As per the documentation, you should add sslmode=disable to your JDBC connection URL or as connection parameter.

Related

Haproxy Postgresql SSL configuration

I need ssl connection between postgresql (patroni cluster) and Haproxy but I didnt find any related docs. Is it possible to configure haproxy via ssl without using pgbouncer or pgpool tools.
I can connect directly to the database server with ssl configuration
but I can't connect by using Haproxy,
-bash-4.2$ psql -d "host=x.x.x.x port=7010 dbname=postgres user=test"
psql: error: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
-bash-4.2$
there is no log record on postgresql.
Thanks.

pgbouncer throws Pooler Error: Auth Failed when using datagrip but NOT when using pgadmin

I have a postgres database (version 9.2) running on Centos 6.9.
I am running pgbouncer version 1.6.1
When I try connect to postgres using datagrip from my Mac, I get:
08P01: Error: Auth Failed
And I get on the server:
/var/log/pgbouncer.log
2021-05-21 18:29:02.644 7489 WARNING C-0x15cf078: postgres/jode#127.0.0.1:56254 Pooler Error: Auth failed
When I login to postgres using Pgadmin 4 from the same Mac and same settings, I get right in and there are no errors or warnings in pgbouncer.
What could the problem?
PgAdmin is not working via JDBC. So you need to configure pgBouncer to accept TCP/IP connections (see similar dba exchange question)

pgAdmin is throwing Error saving properties unable to connect server timeout expired connecting to Postgresql in AWS Lightsail

I have a Linux instance in AWS Lightsail and I have started up a PostgreSQL database on my LightSail hosted Linux server. On my local Windows 10 machine, I have a Postgresql server as well. When I am attempting to connect to the AWS Postgresql server on Lightsail following the steps described here:
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connecting-to-your-postgres-database
On my pgAdmin (my pgAdmin is acting as the client while the Postgresql database that I have on AWS is the server), I am seeing the following error message:
Error saving properties
Unable to connect to the server:
timeout expired
Please note, my database is hosted by Lightsail and not by AWS RDS.
use SSL tunnel with your ip and pem file under SSH Tunnel Tab
Under connection user the ip 127.0.0.1 with your postgres username and password.

Cant connect with cloud_sql_proxy over tcp

I created a Cloud SQL instance and am trying to connect from my laptop running OSX El Capitan.
I followed the instructions for creating a proxy to run the proxy. I am able to connect if I use a socket file as follows:
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:mysql-instance -credential_file=mycredentials.json
mysql -u root -p -S /cloudsql/my-project:us-central1:mysql-instance
Now I'd like to connect to the Cloud SQL instance from a local python application. So I tried creating the proxy over tcp using =tcp:3306 and testing using the mysql client as follows:
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:mysql-instance=tcp:3306 -credential_file=/web/visi/api/resources/keys/visi-staging-ec040759d57a.json
mysql -u root --host 127.0.0.1 --password
But Im getting this error:
2016/04/06 23:09:58 Got a connection for
"my-project:us-central1:mysql-instance" 2016/04/06 23:09:59
to "my-project:us-central1:mysql-instance" via
111.111.111.111:3307: read tcp 127.0.0.1:3306->127.0.0.1:49518: use of closed network connection ERROR 2026 (HY000): SSL connection error:
error:00000005:lib(0):func(0):DH lib
Try specifying --skip-ssl as an option to your mysql client.
We have a fix for this in progress and should be rolled out in the near future.
The reason this happens is that we reject connections over the proxy that request MySQL SSL. The connection between the proxy and Cloud SQL is already done over SSL so there's no need to use SSL at the MySQL level.

How to check if PostgreSQL installation supports SSL?

In the PostgreSQL documentation is described that required to build PostgreSQL for SSL support:
http://www.postgresql.org/docs/9.1/static/ssl-tcp.html
Is it possible that PostgreSQL installation supports SSL out of the box from some CentoOS repository?
How to check if PostgreSQL installation supports SSL?
Pretty much any packaged PostgreSQL will support SSL.
That doesn't mean you can actually connect with SSL. For that, you need a private key and certificate to be configured for that install.
You really have:
Is not compiled with SSL support
Is compiled with SSL support but not configured for SSL
Is compiled with SSL support and configured for SSL, but does not allow SSL connections in pg_hba.conf from my current location
Is compiled with SSL support, configured for SSL, and pg_hba.conf allows (or requires) connections via ssl
The best way to see if it supports SSL, as a client, is to connect to it and see.
If you're checking to see if the server is compiled with SSL support, so SSL will work if you configure it, you can check pg_config.h from the development package; it will define USE_OPENSSL if it's enabled in the build. Or you can try to run the postgres executable with the ssl=on option set, e.g.
/path/to/postgres -c ssl=on
which will output:
FATAL: SSL is not supported by this build
if SSL isn't available.