F09: 只写流重试在没有反压力的情况下累积对等方明文
作者: djc创建于 2026年9月30日更新于 2026年9月30日
use rustls::crypto::Identity; use rustls::pki_types::{CertificateDer, PrivateKeyDer, pem::PemObject}; use rustls::{ ClientConfig, ClientConnection, Connection, RootCertStore, ServerConfig, ServerConnection, VecInput, }; use rustls_util::StreamOwned; use std::{ io::{self, Write}, net::{TcpListener, TcpStream}, sync::{ Arc, atomic::{AtomicBool, Ordering}, }, thread, time::{Duration, Instant}, };
fn pair() -> (ClientConnection, ServerConnection) { let provider = Arc::new(rustls_ring::DEFAULT_PROVIDER.clone());
// Trust the fixture CA so later failures are unrelated to certificate rejection.
let mut roots = RootCertStore::empty();
roots
.add(CertificateDer::from(
…
内容来源: rustls/rustls