will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
462 stars 77 forks source link

fix: enable SNI #282

Closed conradludgate closed 3 months ago

conradludgate commented 7 months ago

👋 At Neon, we use SNI to know which database endpoint is being requested to connect to. Our fallback options are using options which this library also doesn't support, or using cleartext passwords and encoding the database endpoint into the password. See https://neon.tech/docs/connect/connection-errors#the-endpoint-id-is-not-specified

Reading https://forum.crystal-lang.org/t/specifying-the-sni-hostname-for-an-openssl-context/3872 it seems like enabling SNI wasn't too challenging. Testing locally it does seem to work.

maattdd commented 3 months ago

I confirm it works fine, could this be merged ? cc @bcardiff

bcardiff commented 3 months ago

Merged! Thanks for the nudge

will commented 3 months ago

Thanks @conradludgate! (and also thanks @bcardiff for getting to this before I did)