lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.86k stars 908 forks source link

allow ssl over UNIX domain sockets #1112

Closed drakkan closed 1 year ago

drakkan commented 1 year ago

It is not supported in Postgres 9.6

https://www.postgresql.org/docs/9.6/runtime-config-connection.html

SSL communication is only possible with TCP/IP connections.

but it is supported in Postgres 10 and above

https://www.postgresql.org/docs/10/runtime-config-connection.html

Here are the supported Postgres versions:

https://www.postgresql.org/support/versioning/

cbandy commented 1 year ago

I haven't looked at postgres code for this recently, but the docs for libpq say:

sslmode is ignored for Unix domain socket communication.

drakkan commented 1 year ago

you're right, this is an oversight. I was working on multi host connections and that code creates problems if one of the hosts is a unix domain socket. We have to keep that check. Thank you