Andriamanitra / coctus

Command line tool for playing clashes and I/O puzzles from CodinGame locally
MIT License
4 stars 2 forks source link

use Rustls-TLS instead of OpenSSL #67

Closed Andriamanitra closed 5 months ago

Andriamanitra commented 5 months ago

fixes #66

With these changes I was able to build a working statically linked (musl libc) binary, but I don't know what the tradeoffs between OpenSSL and Rustls-TLS are. We could use conditional compilation if it turns out there are strong reasons to prefer dynamically linked OpenSSL on non-statically linked targets. I would prefer to keep it simple and just use Rustls-TLS everywhere if it works though.

To verify the changes work I targeted x86_64-unknown-linux-musl to produce a statically linked executable (requires clang):

$ rustup target add x86_64-unknown-linux-musl
$ CC_x86_64_unknown_linux_musl=clang cargo build --target=x86_64-unknown-linux-musl
$ ./target/x86_64-unknown-linux-musl/debug/coctus fetch 854868742749fd0826baef7851baace4e986c

(I believe you could also specify musl-gcc instead of clang as the C compiler if you happen to have that)


Reqwest TLS docs: https://docs.rs/reqwest/latest/reqwest/tls/index.html