Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set sslmode=require parameter on a Postgres connection #214

Open
deenar opened this issue Sep 20, 2020 · 0 comments
Open

Unable to set sslmode=require parameter on a Postgres connection #214

deenar opened this issue Sep 20, 2020 · 0 comments

Comments

@deenar
Copy link

deenar commented Sep 20, 2020

Hi

I am trying to connect to a Postgres hosted by Heroku.

https://devcenter.heroku.com/articles/heroku-postgresql#heroku-postgres-ssl

import com.twitter.finagle.Postgres
val client = Postgres.Client()
.withCredentials("xx", Some("xx"))
.database("xx")
.withSessionPool.maxSize(1)
.newRichClient("xx.eu-west-1.compute.amazonaws.com:5432")

returns an error saying ssl is off as expected
com.twitter.finagle.postgres.codec.ServerError: no pg_hba.conf entry for host "82.2.102.2", user "xx", database "xx", SSL off

I am unable to set sslmode=require on the underlying connection. I have tried
val client = Postgres.Client()
.withCredentials("xx", Some("xx"))
.database("xx")
.withSessionPool.maxSize(1)
.conditionally(true, _.withTransport.tlsWithoutValidation)
.withTransport.tls("amazonaws.com")
.newRichClient("xx.eu-west-1.compute.amazonaws.com:5432")

val client = Postgres.Client()
.withCredentials("xx", Some("xx"))
.database("xx")
.withSessionPool.maxSize(1)
.withTransport.tls("amazonaws.com")
.newRichClient("xx.eu-west-1.compute.amazonaws.com:5432")

val client = Postgres.Client()
.withCredentials("xx", Some("xx"))
.database("xx")
.withSessionPool.maxSize(1)
.conditionally(true, _.withTransport.tlsWithoutValidation)
.newRichClient("xx.eu-west-1.compute.amazonaws.com:5432")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant