Compare commits

...

2 commits
v4.0.1 ... main

Author SHA1 Message Date
db523065e0 feat: remove openssl transitive dependency
All checks were successful
/ test (map[name:nightly]) (push) Successful in 43s
/ test (map[name:stable]) (push) Successful in 45s
2025-01-18 20:53:11 +00:00
3f87d011e7 feat: add dbus-dev to image
All checks were successful
/ test (map[name:nightly]) (push) Successful in 1m16s
/ test (map[name:stable]) (push) Successful in 1m21s
2025-01-18 20:25:51 +00:00
6 changed files with 28 additions and 21 deletions

View file

@ -4,6 +4,5 @@ version = "0.1.0"
edition = "2021"
[dependencies]
kxio = "5.0"
native-tls = { version = "0.2", features = ["vendored"] }
kxio = "5.1"
tokio = { version = "1.43", features = ["full"] }

View file

@ -39,6 +39,7 @@ RUN apk add --no-cache \
libssl3 \
openssl-dev \
perl \
dbus-dev \
git
# clang \

View file

@ -42,6 +42,7 @@ The available toolchain in the image are:
- cargo-chef
- cargo-hack
- release-plz
- dbus-dev
- perl
### Scripts
@ -61,10 +62,33 @@ steps:
## Caveats
### native-tls
### openssl
The alpine linux install doesn't build with this dependency. You can either compile `native-tls` with the `vendored` feature, or not use `openssl`.
#### vendoered native-tls
This crate *must* use the `vendored` feature in order to compile in the Alpine Linux image.
```toml
native-tls = { version = "0.2", features = ["vendored"] }
```
#### Don't use `openssl`
Check that none of your dependencies require `openssl`:
```bash
cargo tree --edges normal -i openssl
```
This will list the tree of dependencies that are bringing in `openssl`.
If you do need ssl/tls, try using `rustls`. e.g.
```toml
reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
] }
```

View file

@ -1,4 +1,4 @@
image := "git.kemitix.get/kemitix/rust:test"
image := "git.kemitix.net/kemitix/rust:test"
build:
docker build . -t {{ image }}

View file

@ -1,10 +1,8 @@
//
mod kxio;
mod tls;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Hello, world!");
tls::main();
let rt = tokio::runtime::Runtime::new()?;
Ok(rt.block_on(crate::kxio::main())?)

View file

@ -1,15 +0,0 @@
use native_tls::TlsConnector;
use std::io::{Read, Write};
use std::net::TcpStream;
pub fn main() {
let connector = TlsConnector::new().unwrap();
let stream = TcpStream::connect("google.com:443").unwrap();
let mut stream = connector.connect("google.com", stream).unwrap();
stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
let mut res = vec![];
stream.read_to_end(&mut res).unwrap();
println!("{}", String::from_utf8_lossy(&res));
}