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

How to properly setup PostgreSQL connection with TLS\SSL #1191

Open
zwpdbh opened this issue Jan 19, 2025 · 0 comments
Open

How to properly setup PostgreSQL connection with TLS\SSL #1191

zwpdbh opened this issue Jan 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@zwpdbh
Copy link

zwpdbh commented Jan 19, 2025

Is the some example to demostrate how to setup TLS\SSL when connecting to a postgres server?

I am new to this area and not sure how to setup TSL\SSL when connecting to a postgres server which enabled securit connection.
During production, when I set the DATABASE_URL, the app shows error with :

DATABASE_URL='postgres://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(DATABASE_NAME)?sslmode=verify-full&sslrootcert=certs/US.pem'  cargo loco start -e production
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.29s
     Running `/home/zw/code/rust_programming/myapp/target/debug/backend-cli start -e production`
2025-01-19T12:55:57.345046Z  WARN app: loco_rs::boot: pretty backtraces are enabled (this is great for development but has a runtime cost for production. disable with `logger.pretty_backtrace` in your config yaml) environment=production
Error: DB(Conn(SqlxError(Tls("server does not support TLS"))))

At the app doesn't show anymore how to setup this.

The server i am connecting during production is hosted in Azure by some other group and could be turn off sercurity connection option.

References:

Is there any suggestions how to do it? An working example would be wonderful :)

@zwpdbh zwpdbh added the enhancement New feature or request label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant