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

key contains no private key while using ecc key #1089

Open
benzwt opened this issue Jan 22, 2024 · 1 comment
Open

key contains no private key while using ecc key #1089

benzwt opened this issue Jan 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@benzwt
Copy link

benzwt commented Jan 22, 2024

Version
warp v0.3.6

Platform
Linux Office 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Description

[short summary of the bug]
I ran the tls.rs example.
Things were fine for rsa key.
While using ecc key which came with the examples,
I got

error binding to 127.0.0.1:3030: key contains no private 

[code sample that causes the bug]

  • examples/tls.rs

I expected to see this happen: [explanation]

  • the server should start and serving

Instead, this happened: [explanation]
I got

thread 'main' panicked at /home/benzene/.cargo/registry/src/index.crates.io-6f17d22bba15001f/warp-0.3.6/src/server.rs:550:27:
error binding to 127.0.0.1:3030: key contains no private key
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

full backtrace log

@benzwt benzwt added the bug Something isn't working label Jan 22, 2024
@cscherrNT
Copy link

cscherrNT commented Mar 18, 2024

This is still an issue as it seems. I've read through some source code, and it seems that warp uses PKCS8 only, which is fine by itself, but should be documented, as this is different from other crates, for example rustls, which accepted my EC KEY. Your EC PRIVATE KEY can be converted to a PKCS8 conform key with the following openssl command:

openssl pkcs8 -topk8 -nocrypt -in private.pem -out newpriv.pem

With a PKCS8 conform key, warp succeeds in starting the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants