Compare commits

...

2 Commits

Author SHA1 Message Date
3024816525 hotfix for issue with socktop agent not creating ssl certificate on first launch after upgrade of axum server version.
Some checks failed
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
2025-11-21 00:21:05 -08:00
1d7bc42d59 fix unit test, move to macro cargo_bin! 2025-11-21 00:07:44 -08:00
4 changed files with 10 additions and 5 deletions

2
Cargo.lock generated
View File

@ -2060,7 +2060,7 @@ dependencies = [
[[package]]
name = "socktop_agent"
version = "1.50.1"
version = "1.50.2"
dependencies = [
"anyhow",
"assert_cmd",

View File

@ -1,6 +1,6 @@
[package]
name = "socktop_agent"
version = "1.50.1"
version = "1.50.2"
authors = ["Jason Witty <jasonpwitty+socktop@proton.me>"]
description = "Socktop agent daemon. Serves host metrics over WebSocket."
edition = "2024"
@ -24,7 +24,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = tr
gfxinfo = "0.1.2"
once_cell = "1.19"
axum-server = { version = "0.7", features = ["tls-rustls"] }
rustls = "0.23"
rustls = { version = "0.23", features = ["aws-lc-rs"] }
rustls-pemfile = "2.1"
rcgen = "0.13"
anyhow = "1"

View File

@ -30,6 +30,12 @@ fn arg_value(name: &str) -> Option<String> {
}
fn main() -> anyhow::Result<()> {
// Install rustls crypto provider before any TLS operations
// This is required when using axum-server's tls-rustls feature
rustls::crypto::aws_lc_rs::default_provider()
.install_default()
.ok(); // Ignore error if already installed
#[cfg(feature = "logging")]
tracing_subscriber::fmt::init();

View File

@ -1,4 +1,3 @@
use assert_cmd::prelude::*;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
@ -17,7 +16,7 @@ fn generates_self_signed_cert_and_key_in_xdg_path() {
let xdg = tmpdir.path().to_path_buf();
// Run the agent once with --enableSSL, short timeout so it exits quickly when killed
let mut cmd = Command::cargo_bin("socktop_agent").expect("binary exists");
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("socktop_agent"));
// Bind to an ephemeral port (-p 0) to avoid conflicts/flakes
cmd.env("XDG_CONFIG_HOME", &xdg)
.arg("--enableSSL")