Skip to content

sslmode=required not working for rocket_db_pool with feature diesel_postgres #2820

@xscoops

Description

@xscoops

What's missing?

I would like to use rocket_db_pool with feature diesel_postgres with sslmode=require in the connection url. Unfortunately I get the following error message:

   >> Matched: (a) GET /a
   >> Request guard `Connection < Db >` failed: Some(Get(Backend(ConnectionError(CouldntSetupConfiguration(DatabaseError(UnableToSendCommand, "error performing TLS handshake: no TLS implementation configured")))))).
   >> Outcome: Error(503 Service Unavailable)
   >> No 503 catcher registered. Using Rocket default.
   >> Response succeeded.

I have seen the following message on the diesel-async repo but I have no idea how to integrate the example with my Rocket application:

In the event of using this crate with a sslmode=require flag, it will be necessary to build a TLS cert. There is an example provided for doing this using the rustls crate in the postgres examples folder.

Any help would be greatly appreciated

Ideal Solution

No response

Why can't this be implemented outside of Rocket?

I believe Rocket should have support for secure database built in

Are there workarounds usable today?

There is a diesel-async workaround is described here: https://github.com/weiznich/diesel_async/blob/main/examples/postgres/pooled-with-rustls/src/main.rs

Alternative Solutions

No response

Additional Context

No response

System Checks

  • I do not believe that this feature can or should be implemented outside of Rocket.
  • I was unable to find a previous request for this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestRequest for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions