No new reading. This day synthesizes Weeks 1–3 into a working Rust artifact.
Answer from memory:
TLSInnerPlaintext
TLSCiphertext
close_notify
Build two Rust binaries: mtls-server and mtls-client.
mtls-server
mtls-client
Server behavior:
127.0.0.1:4433
Client behavior:
# Re-use or re-generate certs from Day 15 ./setup_mtls.sh # Certs needed: # ca.crt — trust anchor for both sides # server.crt/key — server identity # client.crt/key — client identity
[dependencies] tokio = { version = "1", features = ["full"] } rustls = "0.23" tokio-rustls = "0.26" rustls-pemfile = "2" x509-parser = "0.16"
// server: TlsAcceptor with client_auth_required // client: TlsConnector with client cert loaded // Use tokio::io::{AsyncReadExt, AsyncWriteExt} for the echo loop
tokio::spawn
ExtendedKeyUsage
clientAuth
ServerConfig::builder_with_provider
ClientConfig
with_client_auth_cert
TlsAcceptor
TlsConnector