0

When I try to connect Postgres db on Heroku, I get the following error:

psql: SSL error: certificate verify failed
FATAL:  no pg_hba.conf entry for host "73.15.187.47", user "first", database "my_db", SSL off

I don't know what I am doing wrong. My Heroku commands history is as follows:

heroku login

Enter your Heroku credentials:
Email: first.last@example.com
Password: ****************

Logged in as first.last@example.com

Find the version

heroku --version

Output

 heroku/7.0.22 darwin-x64 node-v10.0.0

Connecting to db using CLI

   first $ heroku pg:psql postgresql-amorphous-32821 --credential first --app my_db
  --> Connecting to postgresql-amorphous-32821
psql: SSL error: certificate verify failed
FATAL:  no pg_hba.conf entry for host "73.15.187.47", user "first", database "my_db", SSL off

I am on a MacBook and I am trying to figure login to Heroku db. I also tried to connect using PGAdmin. I get the following error.

Unable to connect to server:

SSL error: certificate verify failed

Heroku Pg Info information

=== HEROKU_POSTGRESQL_COPPER_URL, FIRST_URL, DATABASE_URL, HEROKU_POSTGRESQL_SILVER_URL
Plan:                  Premium 2
Status:                Available
HA Status:             Available
Data Size:             85.2 GB
Tables:                121
PG Version:            9.6.6
Connections:           175/400
Credentials:           6
Fork/Follow:           Available
Rollback:              earliest from 2018-04-27 01:23 UTC
Created:               2017-11-15 06:14 UTC
Region:                us
Data Encryption:       In Use
Continuous Protection: On
Followers:             HEROKU_POSTGRESQL_ONYX
Forks:                 HEROKU_POSTGRESQL_PINK
Maintenance:           not required
Maintenance window:    Tuesdays 20:00 to Wednesdays 00:00 UTC
Add-on:                postgresql-amorphous-32821

=== HEROKU_POSTGRESQL_ONYX_URL
Plan:                  Premium 0
Status:                Available
Data Size:             85.2 GB
Tables:                121
PG Version:            9.6.6
Connections:           1/120
Credentials:           6
Fork/Follow:           Unavailable on followers
Rollback:              earliest from 2018-04-27 01:23 UTC
Created:               2017-11-29 23:46 UTC
Region:                us
Data Encryption:       In Use
Continuous Protection: On (on leader)
Following:             NVD
Behind By:             24 commits
Maintenance:           not required
Maintenance window:    Thursdays 20:30 to Fridays 00:30 UTC
Add-on:                postgresql-shaped-81300

=== HEROKU_POSTGRESQL_PINK_URL
Plan:                  Standard 0
Status:                Available
Data Size:             96.5 GB
Tables:                121
PG Version:            9.6.7
Connections:           1/120
Connection Pooling:    Available
Credentials:           5
Fork/Follow:           Available
Rollback:              earliest from 2018-04-30 01:23 UTC
Created:               2018-02-14 05:09 UTC
Region:                us
Data Encryption:       In Use
Continuous Protection: On
Forked From:           NVD
Maintenance:           not required
Maintenance window:    Tuesdays 22:30 to Wednesdays 02:30 UTC
Add-on:                postgresql-metric-29727

Heroku psql info

heroku pg:psql FIRST_URL --app my_db
--> Connecting to postgresql-amorphous-32821
psql: SSL error: certificate verify failed
FATAL:  no pg_hba.conf entry for host "73.15.187.47", user "first", database "my_db", SSL off
halfer
  • 19,824
  • 17
  • 99
  • 186
Kartik
  • 2,541
  • 2
  • 37
  • 59
  • Take a look at the this thread regarding SSL and connections to Heroku: https://stackoverflow.com/questions/17377118/heroku-database-connection-properties/34034960#34034960 – Glenn May 04 '18 at 00:52
  • @Glenn I am not using JDBC url. I am trying to connect using Heroku Cli – Kartik May 04 '18 at 00:55
  • Could you add the output of `heroku pg:info` to the question, and then also the result of `heroku pg:psql ` where `dbname` is from the first query? – Glenn May 04 '18 at 01:10
  • @Glenn Compeleted – Kartik May 04 '18 at 01:32

0 Answers0