[repo] Lab relay: compile fixes after the first build (clippy, fmt); 28 unit tests pass

This commit is contained in:
2026-11-25 13:08:46 +01:00
parent ab5404b0cf
commit fd1c141ca8
6 changed files with 48 additions and 26 deletions
+12 -2
View File
@@ -105,7 +105,13 @@ fn sha256_hex(bytes: &[u8]) -> String {
fn relay(client: TcpStream, config: &Config, spec: PortSpec, rec: &Recorder, conn: u32) -> io::Result<()> {
let upstream_addr = config.upstream_addr(&spec);
let peer = client.peer_addr()?;
rec.log(Kind::Open, Protocol::HttpsPlain, Direction::None, conn, format!("{peer} -> {upstream_addr} (TLS terminated)").as_bytes());
rec.log(
Kind::Open,
Protocol::HttpsPlain,
Direction::None,
conn,
format!("{peer} -> {upstream_addr} (TLS terminated)").as_bytes(),
);
let Some(files) = &config.tls else {
return Err(io::Error::other("TLS files not configured"));
};
@@ -146,7 +152,11 @@ fn relay(client: TcpStream, config: &Config, spec: PortSpec, rec: &Recorder, con
down.protocol_version(),
down.negotiated_cipher_suite().map(|s| s.suite()),
presented.as_deref().unwrap_or("none"),
if presented.as_deref() == Some(expected.as_str()) { "matches the lab client certificate" } else { "differs from the lab client certificate" },
if presented.as_deref() == Some(expected.as_str()) {
"matches the lab client certificate"
} else {
"differs from the lab client certificate"
},
),
);