Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 606c620849 | |||
| 4ae09ac6ae | |||
| 2fce910795 | |||
| ff09cef350 | |||
| d0148b2ac3 | |||
| 7217e15649 |
19
changelog.md
19
changelog.md
@@ -1,5 +1,24 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-20 - 25.17.8 - fix(rustproxy)
|
||||||
|
use SNI-based certificate resolution for QUIC TLS connections
|
||||||
|
|
||||||
|
- Replaces static first-certificate selection with the shared CertResolver used by the TCP/TLS path.
|
||||||
|
- Ensures QUIC connections can present the correct certificate per requested domain.
|
||||||
|
- Keeps HTTP/3 ALPN configuration while improving multi-domain TLS handling.
|
||||||
|
|
||||||
|
## 2026-03-20 - 25.17.7 - fix(readme)
|
||||||
|
document QUIC and HTTP/3 compatibility caveats
|
||||||
|
|
||||||
|
- Add notes explaining that GREASE frames are disabled on both server and client HTTP/3 paths to avoid interoperability issues
|
||||||
|
- Document that the current HTTP/3 stack depends on pre-1.0 h3 ecosystem components and may still have rough edges
|
||||||
|
|
||||||
|
## 2026-03-20 - 25.17.6 - fix(rustproxy-http)
|
||||||
|
disable HTTP/3 GREASE for client and server connections
|
||||||
|
|
||||||
|
- Switch the HTTP/3 server connection setup to use the builder API with send_grease(false)
|
||||||
|
- Switch the HTTP/3 client handshake to use the builder API with send_grease(false) to improve compatibility
|
||||||
|
|
||||||
## 2026-03-20 - 25.17.5 - fix(rustproxy)
|
## 2026-03-20 - 25.17.5 - fix(rustproxy)
|
||||||
add HTTP/3 integration test for QUIC response stream FIN handling
|
add HTTP/3 integration test for QUIC response stream FIN handling
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartproxy",
|
"name": "@push.rocks/smartproxy",
|
||||||
"version": "25.17.5",
|
"version": "25.17.8",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
|
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -1111,6 +1111,10 @@ SmartProxy searches for the Rust binary in this order:
|
|||||||
5. Local dev build (`./rust/target/release/rustproxy`)
|
5. Local dev build (`./rust/target/release/rustproxy`)
|
||||||
6. System PATH (`rustproxy`)
|
6. System PATH (`rustproxy`)
|
||||||
|
|
||||||
|
### QUIC / HTTP3 Caveats
|
||||||
|
- **GREASE frames are disabled.** The underlying h3 crate sends [GREASE frames](https://www.rfc-editor.org/rfc/rfc9114.html#frame-reserved) by default to test protocol extensibility. However, some HTTP/3 clients and servers don't properly ignore unknown frame types, causing 400/500 errors or stream hangs ([h3#206](https://github.com/hyperium/h3/issues/206)). SmartProxy disables GREASE on both the server side (for incoming H3 requests) and the client side (for H3 backend connections) to maximize compatibility.
|
||||||
|
- **HTTP/3 is pre-release.** The h3 ecosystem (h3 0.0.8, h3-quinn 0.0.10, quinn 0.11) is still pre-1.0. Expect rough edges.
|
||||||
|
|
||||||
### Performance Tuning
|
### Performance Tuning
|
||||||
- ✅ Use NFTables forwarding for high-traffic routes (Linux only)
|
- ✅ Use NFTables forwarding for high-traffic routes (Linux only)
|
||||||
- ✅ Enable connection keep-alive where appropriate
|
- ✅ Enable connection keep-alive where appropriate
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ impl H3ProxyService {
|
|||||||
debug!("HTTP/3 connection from {} on port {}", remote_addr, port);
|
debug!("HTTP/3 connection from {} on port {}", remote_addr, port);
|
||||||
|
|
||||||
let mut h3_conn: h3::server::Connection<h3_quinn::Connection, Bytes> =
|
let mut h3_conn: h3::server::Connection<h3_quinn::Connection, Bytes> =
|
||||||
h3::server::Connection::new(h3_quinn::Connection::new(connection))
|
h3::server::builder()
|
||||||
|
.send_grease(false)
|
||||||
|
.build(h3_quinn::Connection::new(connection))
|
||||||
.await
|
.await
|
||||||
.map_err(|e| anyhow::anyhow!("H3 connection setup failed: {}", e))?;
|
.map_err(|e| anyhow::anyhow!("H3 connection setup failed: {}", e))?;
|
||||||
|
|
||||||
|
|||||||
@@ -2550,7 +2550,11 @@ impl HttpProxyService {
|
|||||||
backend_key: &str,
|
backend_key: &str,
|
||||||
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
|
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
|
||||||
let h3_quinn_conn = h3_quinn::Connection::new(quic_conn.clone());
|
let h3_quinn_conn = h3_quinn::Connection::new(quic_conn.clone());
|
||||||
let (mut driver, mut send_request) = match h3::client::new(h3_quinn_conn).await {
|
let (mut driver, mut send_request) = match h3::client::builder()
|
||||||
|
.send_grease(false)
|
||||||
|
.build(h3_quinn_conn)
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(pair) => pair,
|
Ok(pair) => pair,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!(backend = %backend_key, domain = %domain, error = %e, "H3 client handshake failed");
|
error!(backend = %backend_key, domain = %domain, error = %e, "H3 client handshake failed");
|
||||||
|
|||||||
@@ -1003,44 +1003,25 @@ impl RustProxy {
|
|||||||
fn build_quic_tls_config(
|
fn build_quic_tls_config(
|
||||||
tls_configs: &HashMap<String, TlsCertConfig>,
|
tls_configs: &HashMap<String, TlsCertConfig>,
|
||||||
) -> Option<Arc<rustls::ServerConfig>> {
|
) -> Option<Arc<rustls::ServerConfig>> {
|
||||||
// Find the first available cert (prefer wildcard, then any)
|
if tls_configs.is_empty() {
|
||||||
let cert_config = tls_configs.get("*")
|
|
||||||
.or_else(|| tls_configs.values().next());
|
|
||||||
|
|
||||||
let cert_config = match cert_config {
|
|
||||||
Some(c) => c,
|
|
||||||
None => return None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Parse cert chain from PEM
|
|
||||||
let mut cert_reader = std::io::BufReader::new(cert_config.cert_pem.as_bytes());
|
|
||||||
let certs: Vec<rustls::pki_types::CertificateDer<'static>> =
|
|
||||||
rustls_pemfile::certs(&mut cert_reader)
|
|
||||||
.filter_map(|r| r.ok())
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
if certs.is_empty() {
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse private key from PEM
|
// Reuse CertResolver for SNI-based cert selection (same as TCP/TLS path).
|
||||||
let mut key_reader = std::io::BufReader::new(cert_config.key_pem.as_bytes());
|
// This ensures QUIC connections get the correct certificate for each domain
|
||||||
let key = match rustls_pemfile::private_key(&mut key_reader) {
|
// instead of a single static cert.
|
||||||
Ok(Some(key)) => key,
|
let resolver = match rustproxy_passthrough::tls_handler::CertResolver::new(tls_configs) {
|
||||||
_ => return None,
|
Ok(r) => r,
|
||||||
};
|
|
||||||
|
|
||||||
let mut tls_config = match rustls::ServerConfig::builder()
|
|
||||||
.with_no_client_auth()
|
|
||||||
.with_single_cert(certs, key)
|
|
||||||
{
|
|
||||||
Ok(c) => c,
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Failed to build QUIC TLS config: {}", e);
|
warn!("Failed to build QUIC cert resolver: {}", e);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut tls_config = rustls::ServerConfig::builder()
|
||||||
|
.with_no_client_auth()
|
||||||
|
.with_cert_resolver(Arc::new(resolver));
|
||||||
|
|
||||||
// QUIC requires h3 ALPN
|
// QUIC requires h3 ALPN
|
||||||
tls_config.alpn_protocols = vec![b"h3".to_vec()];
|
tls_config.alpn_protocols = vec![b"h3".to_vec()];
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartproxy',
|
name: '@push.rocks/smartproxy',
|
||||||
version: '25.17.5',
|
version: '25.17.8',
|
||||||
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
|
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user