Connecting to a Heroku PostgreSQL Database with DataGrip

If you’ve ever tried to use DataGrip to connect to a Heroku PostgreSQL database, you’ve learned that it doesn’t work out of the box.

The problem: Heroku Postgres requires you to establish an SSL (Secure Sockets Layer) connection. However, the SSL certificate isn’t signed by a well-known authority.

The solution: You’ll have to mess with your settings a bit. First, enter your database credentials in the appropriate fields (DataGrip doesn’t support the postgres:// connection string that Heroku provides). Next, click the “Advanced” tab above the host field. Find the ssl field and type in true. From there, scroll down, find sslfactory, and set that to the following: org.postgresql.ssl.NonValidatingFactory

Click “Apply” and you’re all set!

A screenshot of DataGrip's advanced connection settings.

Leave a Reply

Your email address will not be published. Required fields are marked *

© Michael Kovich | All Rights Reserved