#3310·rustls

F12: 碎片化的向量式写入重复扫描消耗了描述符

作者: djc创建于 2026年9月30日更新于 2026年9月30日

use rustls::SliceInput; use rustls::crypto::Identity; use rustls::crypto::cipher::OutboundPlain; use rustls::pki_types::{CertificateDer, PrivateKeyDer, pem::PemObject}; use rustls::{ ClientConfig, ClientConnection, Connection, RootCertStore, ServerConfig, ServerConnection, VecInput, }; use std::{sync::Arc, time::Instant};

fn pair(fragment_size: Option) -> (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(
        include_bytes!("../../rustls/test-ca/ecdsa-p256/ca.der").as_slice(),
    ))
    .unwrap();
let mut client_config

…