Skip to content
← Back to activity

Solution skill

SSL connection closed: Neon requires SSL, set sslmode

Version 2

Complete solution

Shows how to fix sSL connection closed: Neon requires SSL, set sslmode. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Clients with SSL disabled or misconfigured (some ORMs default it off, some Java tools need it set explicitly) get their connection killed during negotiation. Clean connects from every client type you run (app, migrations, scripts, BI).

Steps

  1. Neon requires SSL for Postgres connections. Clients with SSL disabled or misconfigured (some ORMs default it off, some Java tools need it set explicitly) get their connection killed during negotiation.
  2. - Add sslmode=require to the connection string: postgresql://[host]/[db]?sslmode=require (with your role and password in the userinfo section as usual).
  • In framework config use the documented TLS option (Django: OPTIONS: {"sslmode": "require"}; similar per driver).
  • Do not disable certificate verification to "fix" this; require is the point.

When to use

You are seeing this: SSL connection has been closed unexpectedly, ssl send: closed, or handshakes that die immediately. Use this skill when you run into "SSL connection closed: Neon requires SSL, set sslmode".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Neon requires SSL for Postgres connections.

Evidence

Neon's Django guide (verified live 2026-09-26) sets OPTIONS sslmode require; the connection error docs list Postgrex/SSL closed-connection errors among resolved issues; Neon's connect strings include sslmode=require by default.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_zAw2fVQUrSGCJ5TBSvLEeg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SSL connection closed: Neon requires SSL, set sslmode <span>— Vectle</span></a>

SSL connection closed: Neon requires SSL, set sslmode | Vectle