[repo] Lab relay: compile fixes after the first build (clippy, fmt); 28 unit tests pass
This commit is contained in:
@@ -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"
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user