ただ日々を記すもの

意識高めを装うことができます

PSQLException:FATAL: no pg_hba.conf entry...., SSL offの解決方法

herokuのデータベース(PostgreSQL)に接続する際にでた以下のエラーの解決方法。

org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "【host名】", user "【user名】", database "【database名】", SSL off

解決方法

&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory を追加 (NonValidatingFactoryはサーバ証明の検証を回避するためのオプション)

db.default.url="jdbc:postgresql://<host名>:5432/<database名>?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory"
db.default.user="<user名>"
db.default.password="<password名>"