Repository: thecoshman/http (language: rust)

Issue:
Installing with "cargo install" fails on Ubuntu
`cargo install https` on Ubuntu gives me a 

```
error: failed to run custom build command for `openssl v0.9.24`                                     
process didn't exit successfully: `/tmp/cargo-installbaFa52/release/build/openssl-28365257436483ab/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/zelda/.cargo/registry/src/github.
com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```


Discussion / hints:
Do you have OpenSSL installed (via `sudo apt-get install pkg-config libssl-dev` or otherwise)?
@nabijaczleweli Both libssl-dev and pkg-config are installed, yeah.
This is Ubuntu 19.04 with libssl-dev 1.1.1b-1ubuntu2 and pkg-config 0.29.1-0ubuntu2 in case that helps.
Okay, so: `iron` 0.6.0 ends up pinning `openssl` to 0.9.24 down the line and I haven't been able to force it to use something fresher (fun fact: OpenSSL 1.1.1 support was added in Feb 2018 with https://github.com/sfackler/rust-openssl/commit/276577553501164c183ebffa2accf87380dac8c0, and I hate software), and it doesn't look like they're pushing anything new to Crates.io anytime soon, so :v

*However*, what you *could* do, and what should work is to open `/home/zelda/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs` and replace 

```rust
        _ => panic!("Unable to detect OpenSSL version"),
```

on line 16 with 

```rust
        _ => println!("cargo:rustc-cfg=ossl110");
```

Which will make `openssl` build to target OpenSSL 1.1.0, which OpenSSL 1.1.1 should be API(ABI?)-compatible with.
I'm just going to agree with the "I hate software" statement.
The same goes for Arch Linux, the `hyper-native-tls` crate is probably too old.
I mean, essentially, yeah. `iron` hasn't released since `0.6.0` *2 years* ago, pins `hyper-native-tls` at `0.2` and therefore `openssl` at `0.9`, and I haven't found a reliable way of forcing it to use a newer version of either through `cargo` and friends – the best I found was to apply the patch mentioned above, as based on analysing the `openssl` repo, so I don't think there's anything I can do to alleviate this seamlessly. Sorry!
ergh... is it worth looking to fork `iron` simply to keep it updated?
No for a multitude of reasons, not the least of which is that you wouldn't be able to publish it anyway.
Well obviously we can't publish it as `iron`, but yeah... probably not worth the effort of trying to maintain a fork.
Maybe `iron` can pass own the maintainership?
This is also getting a bit off topic here. If you want to, raise the question of ownership on their project. I don't really have the knowledge or time to develop it, but I would be willing to take on the caretaker role.

As for this issue, I guess it's basically at a stalemate. Either you follow the advice from @nabijaczleweli and hack the build, or you look to have `iron` update. 
> pass the maintainership

You do realise that iron is under active development, right?

In related news, I found https://github.com/iron/iron/issues/584, which means I can probably PR this in.
hmm okay, "active" may've been an overstatement :v
Update: the PR has been merged, if you reinstall `http`, the issue should be resolved by default!
Do you mean `https`? Because that still doesn't work for me.
Yeah, the package name is still `https`. what's the error?
Basically the same as OP I think
```
error: failed to run custom build command for `openssl v0.9.24`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installxEIc3f/release/build/openssl-3491c6dc184890dc/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/user/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `https v1.5.0`, intermediate artifacts can be found at `/tmp/cargo-installxEIc3f`
```
Edit: I'm not using Ubuntu, but Arch Linux with openssl 1.1.1c, maybe that makes a difference

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index bae0f9b..2dc77d8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,14 +9,14 @@ categories = ["network-programming", "web-programming::http-server"]
 license = "MIT"
 build = "build.rs"
 # Remember to also update in appveyor.yml
-version = "1.5.0"
+version = "1.5.1"
 # Remember to also update in http.md
 authors = ["thecoshman <rust@thecoshman.com>",
            "nabijaczleweli <nabijaczleweli@gmail.com>",
            "pheki"]
 
 [dependencies]
-hyper-native-tls = "0.2"
+hyper-native-tls = "0.3"
 lazy_static = "1.2"
 serde_json = "0.9"
 mime_guess = "1.8"
diff --git a/appveyor.yml b/appveyor.yml
index 742e0cf..8071d35 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 1.4.1-{build}
+version: 1.5.1-{build}
 
 skip_tags: false
 
@@ -22,21 +22,21 @@ build: off
 build_script:
   - git submodule update --init --recursive
   - cargo build --verbose --release
-  - cp target\release\http.exe http-v1.4.1.exe
-  - strip --strip-all --remove-section=.comment --remove-section=.note http-v1.4.1.exe
-  - makensis -DHTTP_VERSION=v1.4.1 "/X!include \"EnvVarUpdate.nsh\"" install.nsi
+  - cp target\release\http.exe http-v1.5.1.exe
+  - strip --strip-all --remove-section=.comment --remove-section=.note http-v1.5.1.exe
+  - makensis -DHTTP_VERSION=v1.5.1 "/X!include \"EnvVarUpdate.nsh\"" install.nsi
 
 test: off
 test_script:
   - cargo test --verbose --release
 
 artifacts:
-  - path: http-v1.4.1.exe
-  - path: http v1.4.1 installer.exe
+  - path: http-v1.5.1.exe
+  - path: http v1.5.1 installer.exe
 
 deploy:
   provider: GitHub
-  artifact: /http.*v1.4.1.*\.exe/
+  artifact: /http.*v1.5.1.*\.exe/
   auth_token:
     secure: ZTXvCrv9y01s7Hd60w8W7NaouPnPoaw9YJt9WhWQ2Pep8HLvCikt9Exjkz8SGP9P
   on:


Test patch: