platform: sslmode=verify-full in a database URL fails as a generic configuration error

Ouverte
#2,746 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
postgresql, rust
Domaine
backend, database

Piste de recherche

Start in crates/registry-messaging/src/store.rs at PgConfig::from_str(url).map_err(|_| StoreError::Configuration) and confirm tokio-postgres 0.7.18's accepted sslmode values in Config::from_str. Before writing anything, check whether each runtime's TLS setup verifies both chain and host name, since that decides whether verify-ca/verify-full can be accepted or must be refused with a named error. The same parser appears in BReg, Casework, Scheduling, Document Store, the Adapter facade and job host; docs live in operate/breg.mdx and operate/coordinator.mdx. Done means one rule applied everywhere plus a verify-full test per product.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:platform bug

Problem

A database URL with sslmode=verify-full fails as a generic configuration error. verify-full is the value the PostgreSQL documentation recommends, so operators will write it.

Observed with Messaging during the Stage 0 adopter run for #2745: messagingctl plan reported error[database.unavailable] ... configuration is invalid against a private CA. The same URL with sslmode=require and database.trustedRootCertificateRef worked.

Cause

tokio-postgres 0.7.18 accepts only disable, prefer and require for sslmode (Config::from_str). Any other value fails to parse, and the product maps the parse failure to its generic configuration error. In Messaging that is crates/registry-messaging/src/store.rs, PgConfig::from_str(url).map_err(|_| StoreError::Configuration).

The same parser reads the database URL in BReg, Casework, Scheduling, Document Store, the Adapter facade and the Adapter job host.

The runtimes already force TLS and verify the server certificate against the configured trust roots, whatever sslmode says.

Docs disagree

  • operate/breg.mdx says the URL needs no sslmode parameter, because the runtime requires TLS itself.
  • operate/coordinator.mdx says to use sslmode=require.
  • The other operate pages do not say which values they accept.

Proposal

  1. Pick one rule for every product. Either accept verify-ca and verify-full, since the runtime already verifies the certificate, or refuse them with an error that names sslmode and the accepted values. Accepting them is the simpler adopter path, but only if the runtime's verification is at least what verify-full promises (chain and host name). Check that before choosing.
  2. Put one sentence about sslmode on every operate page that takes a database URL, using the same wording.

Both changes need a test per product that a verify-full URL gives the chosen result.

Langage dominant
Rust
Étoiles
2
Forks
0
Merge moyen
9 h 48 min
PR mergées (30 j)
151

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de registrystack/registry-stack

Toutes les issues de registrystack/registry-stack

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.