Skip to content

ux(postgres): hint to enable SSL when the server rejects the connection with "no encryption" #1754

Closed

Description

@ZhuchkaTriplesix

Problem

A server whose `pg_hba.conf` only allows `hostssl` answers a plain connection with:

```
28000: pg_hba.conf rejects connection for host "10.10.0.129", user "...", database "demo", no encryption
```

Querya shows this raw text in the Test connection result. The cause (SSL is off in the form) is not obvious: it reads like wrong credentials or an IP block. Seen while connecting to startde.postgres.karpov.courses; ticking SSL is the fix.

Proposal

  • When a Postgres connect error is a `pg_hba.conf rejects connection` containing `no encryption`, append a hint to the message: "The server requires an encrypted connection. Enable SSL and try again."
  • In the connection form, offer a one-click "Enable SSL and retry" next to that Test result.
  • Keep the raw server message visible (do not hide it behind the hint).
  • Optional follow-up: an `sslmode=prefer`-style fallback (try plain, then TLS) when the URI has no explicit `sslmode`.

Where

  • `lib/core/database/postgres_connection.dart` (`_connectOnce` catch, `describeDatabaseError`)
  • `lib/features/postgresql/postgresql_connection_form.dart` (`_testConnection`, `_showTestResult`)

Notes

The connect attempt and its raw error are now logged with `debugPrint` (no password), which is how this was diagnosed.

Activity

  1. added
    enhancementNew feature or request
    connectionsDatabase connections, URI parsing, pools
    uxUser experience, keyboard shortcuts and interactions
    P2Medium priority / Parity & Refactoring
    on Oct 25, 2026
  2. added a commit that references this issue on Oct 25, 2026
  3. ZhuchkaTriplesix commented on Oct 25, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Fixed on dev in #1806 (merged). Closing by hand: the PRs target dev, so GitHub would only close this when dev is merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringconnectionsDatabase connections, URI parsing, poolsenhancementNew feature or requestuxUser experience, keyboard shortcuts and interactions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions