simoom-tls 0.1.0

Sans-io TLS 1.3 server and client for simoom, with QUIC support (RFC 9001).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The baseline for `size_server`: the same file and stdin/stdout handling without TLS, built
//! the same way, so the difference is what simoom-tls adds (see that example).

use std::io::{Read, Write};

fn main() {
    let args: Vec<String> = std::env::args().collect();
    if args.len() < 3 {
        eprintln!("usage: size_empty CERT.pem KEY.pem < input");
        std::process::exit(2);
    }
    let cert = std::fs::read(&args[1]).expect("certificate");
    let key = std::fs::read(&args[2]).expect("key");
    let mut input = Vec::new();
    std::io::stdin().read_to_end(&mut input).expect("stdin");
    let out: Vec<u8> = cert.iter().chain(&key).chain(&input).copied().collect();
    std::io::stdout().write_all(&out).expect("stdout");
}