---
title: "Fix PostgreSQL: no pg_hba.conf entry for host / SSL required (SSL_ERR)"
slug: "postgres-ssl-required"
code: "SSL_ERR"
category: "Database Integration"
severity: "High"
canonical: "https://mcp-codex.com/errors/postgres-ssl-required"
source: "MCP Codex (https://mcp-codex.com)"
dateModified: "2026-09-28"
---

# Fix PostgreSQL: no pg_hba.conf entry for host / SSL required (SSL_ERR)

**Category**: Database Integration | **Severity**: High

## Symptom
PostgreSQL MCP server fails to connect to Supabase, Neon, AWS RDS, or Render databases.

## Root Cause
Cloud PostgreSQL instances reject unencrypted plaintext SSL connections by default.

## Remediation & Quick Fix
Append '?sslmode=require' to your connection URL in the MCP configuration args or env block.

## OS Remediation Commands

### MAC
```bash
# Test secure DB connection:
psql "postgresql://user:pass@ep-host.neon.tech/neondb?sslmode=require"
```

### WINDOWS
```bash
# Test secure DB connection in PowerShell:
psql.exe "postgresql://user:pass@ep-host.neon.tech/neondb?sslmode=require"
```

### LINUX
```bash
# Test secure DB connection:
psql "postgresql://user:pass@ep-host.neon.tech/neondb?sslmode=require"
```

## Correct Configuration Example
```json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://user:password@ep-host.neon.tech/neondb?sslmode=require"
      ]
    }
  }
}
```

## Canonical Diagnostic Link
https://mcp-codex.com/errors/postgres-ssl-required

## Weekly Protocol & Patch Diffs
Subscribe to verified runtime fixes and schema changes: https://mcp-codex.com#newsletter
