kettle11 / devserver

A simple HTTPS server for local development. Implemented in Rust.
zlib License
95 stars 15 forks source link

devserver broken on OpenSSL v3 #24

Open rgwood opened 2 years ago

rgwood commented 2 years ago

Hello, thanks for making devserver - it's super useful!

I'm running into an issue where devserver panics as soon as I start it up:

Serving [/home/reilly/source/proj/] 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: 50856204, library: "digital envelope routines", function: "inner_evp_generic_fetch", reason: "unsupported", file: "crypto/evp/evp_fetch.c", line: 349, data: "Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()" }]))', /home/reilly/.cargo/registry/src/github.com-1ecc6299db9ec823/devserver_lib-0.4.1/src/lib.rs:136:62
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1749:5
   3: devserver_lib::run
   4: devserver::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I'm on the new Fedora 36 which adopted OpenSSL v3, and I'm pretty sure that's related. The recently released Ubuntu 22.04 is also on OpenSSL v3 so it might be impacted too.

I'm able to work around this by adding the following to the Cargo.toml for devserver_lib:

openssl = { version = "0.10.40", features = ["vendored"]}

That forces devserver to build and statically link its own copy of OpenSSL. I'm not totally sure if it's the best way to fix this though.

voidDrn commented 2 years ago

I'm able to work around this by adding the following to the Cargo.toml for devserver_lib:

I'm a cargo / rust novice, could you help me locate this file on my ubuntu system? Or If you are referring to my projects Cargo.toml i'm not sure how to configure devserver_lib specifically in my deps

rgwood commented 2 years ago

@voidDrn I'm building devserver from source, this is the file I'm modifying: https://github.com/kettle11/devserver/blob/master/devserver_lib/Cargo.toml

After changing that file, run cargo build and you should get a build of devserver in target/debug that works. You'll need the Rust toolchain installed.

voidDrn commented 2 years ago

Thank you!