Closed mattiaz9 closed 1 year ago
Thanks for this report. Are you using the latest driver version, 0.4.20? We addressed an issue rather like this recently.
Yes, 0.4.20 fixed the SSL issue, but i noticed that setting neonConfig.useSecureWebSocket = false
still cause the request to stuck endlessly.
(If you are using the latest version, try also not changing any neonConfig
settings with that).
setting neonConfig.poolQueryViaFetch = true
is the only way to make it work, but i guess i doesn't use web sockets.
it it any better in term of performance?
The driver options are provided mainly for testing, and for people using their own Postgres instance with a WebSocket proxy. Neon databases are not expected to work when neonConfig.useSecureWebSocket
is false
. I'm currently rewriting the README to reduce the prominence given to these options.
neonConfig.poolQueryViaFetch
should indeed be a bit quicker, and will likely default to true
in an upcoming version (it's false
now while we do a bit of additional testing). If it's working well for you: great. As you suggest, it doesn't use WebSockets, so the useSecureWebSocket
option is irrelevant here.
Steps to reproduce
This is an example route using next.js
Expected result
The executed query result
Actual result
Error: The server does not support SSL connections
Environment
macOS Ventura 13.4 edge runtime / nodejs 18.6 next.js 13.4.7
Logs, links
SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL on the Postgres connection.
Other
I tried disabling SSL:
but now the request to neon db is stuck endlessly.
I also tried not to use drizzle, like in this example: https://neon.tech/docs/serverless/serverless-driver#neon-serverless-driver-with-vercel-edge-functions but the result is the same.