Switch from native-tls to rustls for WebSocket TLS
- Removes OpenSSL dependency entirely - Uses pure Rust TLS implementation (rustls) - Simplifies Docker build (no OpenSSL packages needed) - Fixes Alpine musl build compatibility issues
This commit is contained in:
parent
df9780a087
commit
570a37ffc0
3 changed files with 16 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||||
snmp = "0.2"
|
snmp = "0.2"
|
||||||
ureq = { version = "2.10", features = ["json"] }
|
ureq = { version = "2.10", features = ["json"] }
|
||||||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "net"] }
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "net"] }
|
||||||
tokio-tungstenite = { version = "0.21", features = ["native-tls"] }
|
tokio-tungstenite = { version = "0.21", features = ["rustls-tls-webpki-roots"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ ARG TARGETPLATFORM
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN apk add --no-cache musl-dev protobuf-dev openssl-dev openssl-libs-static
|
RUN apk add --no-cache musl-dev protobuf-dev
|
||||||
|
|
||||||
# Determine Rust target based on platform and add it
|
# Determine Rust target based on platform and add it
|
||||||
RUN case "$TARGETPLATFORM" in \
|
RUN case "$TARGETPLATFORM" in \
|
||||||
|
|
|
||||||
17
build.rs
17
build.rs
|
|
@ -30,7 +30,10 @@ fn get_version() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback: Try short commit hash only
|
// Fallback: Try short commit hash only
|
||||||
if let Ok(output) = Command::new("git").args(["rev-parse", "--short", "HEAD"]).output() {
|
if let Ok(output) = Command::new("git")
|
||||||
|
.args(["rev-parse", "--short", "HEAD"])
|
||||||
|
.output()
|
||||||
|
{
|
||||||
if output.status.success() {
|
if output.status.success() {
|
||||||
let commit = String::from_utf8_lossy(&output.stdout).trim().to_string();
|
let commit = String::from_utf8_lossy(&output.stdout).trim().to_string();
|
||||||
return format!("{}.{}", env!("CARGO_PKG_VERSION"), commit);
|
return format!("{}.{}", env!("CARGO_PKG_VERSION"), commit);
|
||||||
|
|
@ -56,10 +59,18 @@ fn parse_git_describe(desc: &str) -> Option<String> {
|
||||||
let commit_count = parts[0];
|
let commit_count = parts[0];
|
||||||
let hash = parts[1].strip_prefix('g').unwrap_or(parts[1]);
|
let hash = parts[1].strip_prefix('g').unwrap_or(parts[1]);
|
||||||
let version = format!("{}.{}.{}", base, commit_count, hash);
|
let version = format!("{}.{}.{}", base, commit_count, hash);
|
||||||
return Some(if dirty { format!("{}-modified", version) } else { version });
|
return Some(if dirty {
|
||||||
|
format!("{}-modified", version)
|
||||||
|
} else {
|
||||||
|
version
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No commits after tag, just use the tag
|
// No commits after tag, just use the tag
|
||||||
Some(if dirty { format!("{}-modified", desc) } else { desc.to_string() })
|
Some(if dirty {
|
||||||
|
format!("{}-modified", desc)
|
||||||
|
} else {
|
||||||
|
desc.to_string()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue