devserver icon indicating copy to clipboard operation
devserver copied to clipboard

SSL key error on fedora 33

Open arlyon opened this issue 3 years ago • 4 comments

Hey, great tool! I'm getting a crash when I run on fedora, seems the cert is too small:

Serving [...] at [ https://localhost:8080 ] or [ http://localhost:8080 ]
Automatic reloading is enabled!
Stop with Ctrl+C
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Normal(ErrorStack([Error { code: 336245135, library: "SSL routines", function: "SSL_CTX_use_certificate", reason: "ee key too small", file: "ssl/ssl_rsa.c", line: 301 }]))', /home/arlyon/.cargo/registry/src/github.com-1ecc6299db9ec823/devserver_lib-0.1.7/src/lib.rs:121:47
stack backtrace:
   0: rust_begin_unwind
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:85
   2: core::option::expect_none_failed
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/option.rs:1221
   3: devserver_lib::run
   4: devserver::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Here's the failing line: https://github.com/kettle11/devserver/blob/c9827261b88345fdb353e5a583c3a967492b34f2/devserver_lib/src/lib.rs#L121

Should we regenerate and bundle a new cert? Seems the error happens when using keys equal or less than 2048 in length

arlyon avatar Nov 23 '20 13:11 arlyon

Thanks for the report! That's a good catch.

And yup, the certificate will definitely have to be regenerated.

kettle11 avatar Nov 23 '20 16:11 kettle11

Same happens on Ubuntu 20.04.2 LTS x86_64

berkes avatar May 07 '21 16:05 berkes

Sorry for the delay on this fix!

I pushed a new version of devserver with a key size of 2048. Let me know if it fixes the issue!

kettle11 avatar May 07 '21 18:05 kettle11

It works on Ubuntu 20.04.2 LTS x86_64 with the latest version devserver v0.4.0

berkes avatar May 08 '21 14:05 berkes