Skip to content

fix: override PGSSLROOTCERT in psql container#219

Merged
gbartolini merged 6 commits into
cloudnative-pg:mainfrom
GabriFedi97:dev/218
May 27, 2026
Merged

fix: override PGSSLROOTCERT in psql container#219
gbartolini merged 6 commits into
cloudnative-pg:mainfrom
GabriFedi97:dev/218

Conversation

@GabriFedi97
Copy link
Copy Markdown
Contributor

@GabriFedi97 GabriFedi97 commented May 25, 2026

Summary

Fix the broken Chainsaw extension-installed checks after alpine/psql:latest started enforcing TLS certificate verification against the system trust store, and prevent the same class of regression in the future.

Closes #218.

What changed

  • Override PGSSLROOTCERT in the extension-installed Job (generic and PostGIS variants). The upstream image now sets PGSSLROOTCERT=system at the container level, which makes libpq implicitly use sslmode=verify-full against the OS trust store, and CNPG's self-signed CA isn't in it, so connections fail with SSL error: certificate verify failed. Overriding the env var to empty restores the default sslmode for the connectivity probe.
  • Pin alpine/psql to 18.4 by tag + digest in both check-extension Jobs, so a new upstream release can't silently break CI again.
  • Extend the existing Renovate custom manager to also match **/test/*.yaml, so the pinned image is tracked automatically.
  • Override ignorePaths to an empty array, since config:recommended pulls in :ignoreModulesAndTests, which excludes **/test/** and would otherwise hide these files from Renovate.

The latest alpine/psql image sets PGSSLROOTCERT=system at the
container level (upstream commit alpine-docker/multi-arch-docker-images@27830b4),
which makes libpq read the OS trust store and implicitly upgrades
sslmode to verify-full. Since CNPG serves TLS with a self-signed
CA that is not present in the Alpine trust store, the connection
fails with "SSL error: certificate verify failed" before
authentication is attempted.

Override PGSSLROOTCERT with an empty value in the
"extension-installed" Jobs (both the generic and PostGIS variants)
so libpq falls back to the default sslmode and the extension
presence check can complete. See cloudnative-pg#218.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
Pin the alpine/psql image used by the "extension-installed" Jobs
(both the generic and PostGIS variants) to a specific tag and
digest instead of :latest, so test runs are reproducible and a new
upstream release cannot silently break CI (see
cloudnative-pg#218 for the SSL
verification regression that motivated this).

Add a Renovate custom manager covering test/*.yaml and
**/test/*.yaml so the pinned tag is tracked automatically. Because
config:recommended pulls in :ignoreModulesAndTests, which excludes
**/test/** from scanning, override ignorePaths to an empty array
so the new manager can actually see those files.

Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
@GabriFedi97 GabriFedi97 marked this pull request as ready for review May 25, 2026 13:48
@GabriFedi97 GabriFedi97 requested review from a team and NiccoloFei as code owners May 25, 2026 13:48
Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
@mnencia mnencia changed the title fix: unset PGSSLROOTCERT in psql container fix: override PGSSLROOTCERT in psql container May 26, 2026
mnencia added 2 commits May 26, 2026 11:08
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
@hh24k
Copy link
Copy Markdown
Contributor

hh24k commented May 26, 2026

Ran the Chainsaw tests locally per this PR which passes ... approving

@gbartolini gbartolini changed the title fix: override PGSSLROOTCERT in psql container fix: override PGSSLROOTCERT in psql container May 27, 2026
@gbartolini gbartolini merged commit fa420ff into cloudnative-pg:main May 27, 2026
1 check passed
@GabriFedi97
Copy link
Copy Markdown
Contributor Author

The PGSSLROOTCERT env variable has been removed again from latest alpine/psql containers: alpine-docker/multi-arch-docker-images@98e93eb.

I suggest to remove that env var in the Clusters config accordingly as part of #221.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: alpine/psql connections fail the SSL verification

4 participants