#3304·rustls

F06: 拒绝重新协商会导致阻塞流上的错误 EOF

作者: 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::{Read, Write}, sync::Arc, };

fn pair() -> (ClientConnection, ServerConnection) { let mut provider = rustls_ring::DEFAULT_TLS12_PROVIDER.clone(); provider.tls12_cipher_suites = std::borrow::Cow::Owned(vec![ rustls_ring::cipher_suite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, ]); let provider = Arc::new(provider);

// Trust the fixture CA so later failures are unrelated to certificate rejection.
let mut roots = RootCertStore::empty();
roots

…