Skip to content

Updated from 0.3.0 to 0.3.7 and pem files with certs and keys no longer work with warp tls #1113

@jdthomas

Description

@jdthomas

Version
Worked in 0.3.0 fails in 0.3.7.

cat /path/to/my/server.pem | grep 'BEGIN\|END'
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----

Platform
N/A

Description
Usage looks roughly like:

    let (https_addr, https_server) = warp::serve(routes)
        .tls()
        .cert_path(&cert_path)
        .key_path(&cert_path) // key and cert are in same file in .pem files
        .bind_with_graceful_shutdown((addr, *port), async move {
            // ...
        })

In the old code the builder roughly did: "give me the pkcs8 private key" nope, give me the "rsa private key" ok/nope ...

In the 3.7 code it checks that all of the entries in the pem file are keys before using the last entry.

Will post a PR to ignore non-key entries shortly and begin a conversation on the correct fix ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions