Why am I seeing `SSL error: tlsv1 alert protocol version (PG::Error)` when connecting to my Heroku Postgres database?

Issue

I'm suddenly seeing database connection errors such as could not retrieve server_version: tlsv1 alert protocol version or SSL error: tlsv1 alert protocol version (PG::Error).

Resolution

As part of the frequent maintenances we run on our Heroku Data Services, and especially on Heroku Postgres, old, existing services are being migrated to new and updated servers that do no longer accept TLS v1.1 connections. Because of these maintenances, it's possible that your application starts seeing errors when connecting to the database if it was still using deprecated TLS versions.

Connections to these Heroku Postgres databases require using TLS v1.2 or v1.3.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support