Warp .tls() error: method not found


I wrote a little HTTP server using warp.

It works well using HTTP, but i would like to upgrade to HTTPS.

I saw in the doc that there is a .tls(), .cert_path() and .key_path(), which seems perfect. I also see the .TlsServer().

None works. When i try with .tls(), i get the following error:

method not found in `impl warp::Future`

The code is:


Which i don't really understand. So, any help regarding this error could be great, and a solution must be awsome ^


run runs the server and won't return.
serve returns a Server that can be converted into a TlsServer by calling tls.

Make sure that warp's "tls" feature flag is enabled in Cargo.toml.

Try this instead:

warp::serve(routes) // returns Server
                .tls() // returns TlsServer
                .run(bind_addr) // returns Future<Output=()>
1 Like

awsome ^^


1 Like