Severe performance issue in Npgsql 10 when PGSSLROOTCERT is set to system store

Aperta
#6,417 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

  • #6418 di @qualcuno — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, postgresql

Direzione di ricerca

Start by reading commit 73202604c3d66d4b55c81d3d532bf0e78cc5c2ee and the linked pull request #6418 to understand the certificate-chain validation change and work already underway. Compare the system-store case with custom certificate files; done means avoiding the reported connection-timeout performance problem while preserving the expected validation for custom files.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

After updating from Npgsql 8 to 10, we experienced frequent database connection timeouts, and traced them to commit 73202604c3d66d4b55c81d3d532bf0e78cc5c2ee, which adds an additional certificate chain validation in case the PGSSLROOTCERT environment variable is set.

While this additional validation is expected if PGSSLROOTCERT is set to a custom file, it becomes a significant performance problem if PGSSLROOTCERT is in fact set to the system certificate store, which was the case in the environment I was operating in -- probably because in contrast to Npgsql, libpq requires PGSSLROOTCERT for certificate validation. The reason for the large performance difference is that the actual system store includes a cache, whereas the custom certificates are loaded from disk every time.

As I expect other users to run into the same problem, it would be useful if Npgsql could detect this problem and either silently use the system store or at least warn the user and instruct them to unset PGSSLROOTCERT specifically for the Npgsql-based application. I will create a PR, but unfortunately I could not find a way to ask .NET for the system store location it actually used.

Lingua principale
C#
Stelle
3.7k
Fork
890
Merge medio
4g 11h
PR unite (30g)
19

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di npgsql/npgsql

Tutte le issue di npgsql/npgsql

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.