Sitemap

How to Fix “Received fatal alert: unexpected_message” in DBeaver While Connecting to PostgreSQL

2 min readFeb 24, 2026

--

Introduction

If you’re trying to connect to a PostgreSQL database using DBeaver and you see this error:

How to Fix “Received fatal alert: unexpected_message” in DBeaver While Connecting to PostgreSQL
Received fatal alert

Don’t worry — this is a very common issue, and it’s usually caused by an SSL configuration mismatch between DBeaver and PostgreSQL.

In this guide, I’ll explain:

  • Why this error happens
  • What it actually means
  • And how to fix it in under 2 minutes

Why This Error Happens

The error:

Received fatal alert: unexpected_message

is a TLS/SSL handshake failure.

This happens when:

  • DBeaver tries to connect using SSL
  • But PostgreSQL server is not configured for SSL
  • Or the SSL mode does not match the server configuration

In simple words:
The client and server are speaking different security protocols.

Quick Fix (Works in Most Local Setups)

If you’re connecting to a local PostgreSQL installation, SSL is usually disabled by default.

Step-by-step Fix:

  1. Open DBeaver
  2. Right-click your connection → Edit Connection
  3. Go to the SSL tab
  4. Change:
SSL Mode = disable
  1. Click Test Connection
  2. Click Finish

That’s it 🎉

Why Disabling SSL Works

In most local setups:

  • PostgreSQL runs with:
ssl = off
  • inside postgresql.conf
  • But DBeaver may default to:
  • SSL Mode = require

This mismatch causes the TLS handshake to fail.

When you set SSL Mode to disable, both sides agree — and the connection succeeds.

What If You’re Connecting to a Remote Server?

If you’re connecting to:

  • Cloud database
  • Company server
  • Production database

Then you should NOT disable SSL.

Instead, try:

SSL Mode = require

or

SSL Mode = prefer

Check with your database administrator for the correct SSL configuration.

Other Possible Causes

Although SSL mismatch is the most common reason, this error can also occur due to:

  • Wrong port (PostgreSQL default is 5432)
  • PostgreSQL service not running
  • Corrupted JDBC driver
  • Connecting to a non-PostgreSQL service

Driver used by DBeaver:
PostgreSQL JDBC Driver

If needed, update the driver from:
Edit Connection → Driver Settings → Download/Update.

Final Thoughts

If you encounter:

How to Fix “Received fatal alert: unexpected_message” in DBeaver While Connecting to PostgreSQL
Received fatal alert

Don’t panic.

In 90% of local development environments, simply:

Set SSL Mode to disable

And your connection will work instantly.

If this helped you, consider sharing it with other developers who might run into the same issue.

Happy querying 🚀

--

--

Chinmay Roy
Chinmay Roy

Written by Chinmay Roy

Software Engineer | Backend Python/Django Developer | Database Management, REST APIs, Nginx, Linux Expert | Follow on Medium to support.