Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PostgreSQL: rustls invalid peer certificate: Other(UnsupportedCertVersion) #2886

Closed
wyhaya opened this issue Nov 20, 2023 · 1 comment
Labels

Comments

@wyhaya
Copy link
Contributor

wyhaya commented Nov 20, 2023

Bug Description

I get this error when trying to connect to railway's Postgres database using sqlx

Minimal Reproduction

// Features: "postgres", "runtime-tokio-rustls"
// Error: error communicating with database: invalid peer certificate: Other(UnsupportedCertVersion)
let pool = PgPool::connect("postgresql://...").await?;

There is no problem using native-tls, it only occurs when using rustls.

  • Railway's postgres database support TLSv1.3

Info

  • SQLx version: 0.7.2
  • SQLx features enabled: "postgres", "runtime-tokio-rustls"
  • Database server and version: Postgres <16.0>
  • Operating system: any
  • rustc --version: rustc 1.73.0 (cc66ad468 2023-10-03)
@wyhaya wyhaya added the bug label Nov 20, 2023
@abonander
Copy link
Collaborator

Likely not a bug. Rustls (via webpki) only supports x.509v3 certificates: rustls/webpki#29 (comment)

You should ask railway to get new TLS certificates. Or just use native-tls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants