Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
10-20 hang on connections when SSL Mode is set to Prefer or Require in connection string #2145
When having SSL set to either require or prefer connections are often taking 10 seconds plus. The connection appears to hang. This does not occur when SSL mode is set to disable. Wireshark captures below. I've also tried using SslStream.
Other SSL connections to the PostGres instance do not have this problem
Further technical details
Npgsql version: 4.0.2
Just to be sure, so connecting with psql with SSL on works without issues, from the same client machine to the same PostgreSQL server? Is it possible for you to also post a wireshark dump of a working SSL connection with psql so we can compare?
Another idea is to try with another client/server pair, ideally without any sort of complicated network setup in between, just to make sure this isn't somehow affected by your network or server setup (although if psql works well we still have a problem).
Also, just to make sure, can you please include
The above tests are all from the same server to the same RDS instance. The tests showing the connection string are using NPGSQL.
This is running in Amazon RDS so you do not get to configure the cipher settings. We are getting the issue in both our production and development environments. I can try it outside of Amazon but its going to take some time for me to setup.
Thanks for your help.
I'm not sure I understand, the wireshark you posted of the PGAdmin connection shows the same 15-second delay as the Npgsql connection test... so it seems that the problem isn't Npgsql-related at all, but some sort of general issue when connecting to your PostgreSQL, no?