From 86afe907d90778fa2c4d0a4f233c7356e47235cc Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 13:26:13 +0000 Subject: [PATCH] Use retrossl's session resumption; take its new ciphers retrossl now has session resumption, renegotiation, IDEA and RC2. Old clients through CONNECT resume their sessions, which spares slow machines an RSA decryption per connection. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRRH4kntyPfrY1bFWC3 --- README.md | 6 ++++-- go.mod | 2 +- go.sum | 4 ++-- internal/proxy/oldssl.go | 5 ++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0814cf9..a3df06b 100644 --- a/README.md +++ b/README.md @@ -165,8 +165,10 @@ and TLS 1.0 server. The proxy looks at each client's first bytes: SSL 3.0 and TLS 1.0 to 1.3 are on, and SSL 2.0 is off. `SslCipherSuites` also accepts retrossl's suite names, such as `TLS_RSA_EXPORT_WITH_RC4_40_MD5`. -retrossl offers AES, 3DES, RC4 and DES, and the 40- and 56-bit export suites -for export builds of old browsers. Site certificates must have RSA keys, +retrossl offers AES, 3DES, RC4, IDEA, RC2 and DES, and the 40- and 56-bit +export suites for export builds of old browsers. Sessions resume, which +saves slow machines an RSA operation on every connection, and clients that +support secure renegotiation may renegotiate. Site certificates must have RSA keys, which the proxy's do. These protocols are easy to break, so the traffic between an old browser and the proxy should be treated as readable. Clients that use the plain HTTP proxy instead are not affected: the browser asks for diff --git a/go.mod b/go.mod index 57c4464..146165f 100644 --- a/go.mod +++ b/go.mod @@ -7,4 +7,4 @@ require ( golang.org/x/text v0.44.0 ) -require github.com/D-Modem/retrossl v0.0.0-20261111130219-1b844ee3e801 +require github.com/D-Modem/retrossl v0.0.0-20261111132527-5c74d8027d9e diff --git a/go.sum b/go.sum index 9c98fdb..fb7a18b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/D-Modem/retrossl v0.0.0-20261111130219-1b844ee3e801 h1:QsbvUo6CAawdQTChTwd5wFMS7g2bYMoVL6d1OxnLFdI= -github.com/D-Modem/retrossl v0.0.0-20261111130219-1b844ee3e801/go.mod h1:+/qpHsaYk4DslA351ZMumscq9/Iwl/K5vS4PhUVLOR8= +github.com/D-Modem/retrossl v0.0.0-20261111132527-5c74d8027d9e h1:4v6nEr6aSiE8H/RmTpg29q+P/RFvjzUlnTFRCdvu8XQ= +github.com/D-Modem/retrossl v0.0.0-20261111132527-5c74d8027d9e/go.mod h1:+/qpHsaYk4DslA351ZMumscq9/Iwl/K5vS4PhUVLOR8= github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= diff --git a/internal/proxy/oldssl.go b/internal/proxy/oldssl.go index 936a9ac..e856600 100644 --- a/internal/proxy/oldssl.go +++ b/internal/proxy/oldssl.go @@ -28,7 +28,10 @@ func (s *Server) makeClientRetro() *retrossl.Config { if len(on) == 0 { return nil } - rc := &retrossl.Config{MinVersion: on[0], MaxVersion: on[len(on)-1]} + // One session cache for every site: a session only resumes with the + // certificate it was made with. + rc := &retrossl.Config{MinVersion: on[0], MaxVersion: on[len(on)-1], + SessionCache: retrossl.NewSessionCache(0, 0)} if len(s.cfg.SslCipherSuites) > 0 { rc.CipherSuites = []uint16{} for _, cs := range retrossl.CipherSuites() {