fix(rust,ts): initialize rustls ring CryptoProvider at startup; add rustls dependency and features; make native binary lookup platform-aware

This commit is contained in:
2026-02-17 09:56:23 +00:00
parent ad67f2e265
commit e25b193f59
8 changed files with 31 additions and 8 deletions

View File

@@ -1,5 +1,13 @@
# Changelog # Changelog
## 2026-02-17 - 3.0.3 - fix(rust,ts)
initialize rustls ring CryptoProvider at startup; add rustls dependency and features; make native binary lookup platform-aware
- Install rustls::crypto::ring default_provider at startup to ensure ring-based crypto is available before any TLS usage.
- Add rustls dependency to remoteingress-bin and update remoteingress-core rustls configuration (disable default-features; enable ring, logging, std, tls12).
- Adjust TS classes to prefer platform-suffixed production binaries, add exact fallback names, and include explicit cargo output paths for release/debug.
- Cargo.lock updated to include rustls entry.
## 2026-02-16 - 3.0.2 - fix(readme) ## 2026-02-16 - 3.0.2 - fix(readme)
Document Hub/Edge architecture and new RemoteIngressHub/RemoteIngressEdge API; add Rust core binary, protocol and usage details; note removal of ConnectorPublic/ConnectorPrivate (breaking change) Document Hub/Edge architecture and new RemoteIngressHub/RemoteIngressEdge API; add Rust core binary, protocol and usage details; note removal of ConnectorPublic/ConnectorPrivate (breaking change)

1
rust/Cargo.lock generated
View File

@@ -509,6 +509,7 @@ dependencies = [
"log", "log",
"remoteingress-core", "remoteingress-core",
"remoteingress-protocol", "remoteingress-protocol",
"rustls",
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",

View File

@@ -16,3 +16,4 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
log = "0.4" log = "0.4"
env_logger = "0.11" env_logger = "0.11"
rustls = { version = "0.23", default-features = false, features = ["ring"] }

View File

@@ -85,6 +85,11 @@ fn send_error(id: &str, error: &str) {
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
// Install the ring CryptoProvider before any TLS usage
rustls::crypto::ring::default_provider()
.install_default()
.expect("Failed to install rustls ring CryptoProvider");
let cli = Cli::parse(); let cli = Cli::parse();
if !cli.management { if !cli.management {

View File

@@ -7,7 +7,7 @@ edition = "2021"
remoteingress-protocol = { path = "../remoteingress-protocol" } remoteingress-protocol = { path = "../remoteingress-protocol" }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
tokio-rustls = "0.26" tokio-rustls = "0.26"
rustls = { version = "0.23", features = ["ring"] } rustls = { version = "0.23", default-features = false, features = ["ring", "logging", "std", "tls12"] }
rcgen = "0.13" rcgen = "0.13"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/remoteingress', name: '@serve.zone/remoteingress',
version: '3.0.2', version: '3.0.3',
description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.' description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.'
} }

View File

@@ -61,9 +61,13 @@ export class RemoteIngressEdge extends EventEmitter {
requestTimeoutMs: 30_000, requestTimeoutMs: 30_000,
readyTimeoutMs: 10_000, readyTimeoutMs: 10_000,
localPaths: [ localPaths: [
plugins.path.join(packageDir, 'dist_rust'), // Platform-suffixed binary in dist_rust (production)
plugins.path.join(packageDir, 'rust', 'target', 'release'), plugins.path.join(packageDir, 'dist_rust', `remoteingress-bin_${process.platform === 'win32' ? 'windows' : 'linux'}_${process.arch === 'x64' ? 'amd64' : process.arch}`),
plugins.path.join(packageDir, 'rust', 'target', 'debug'), // Exact binaryName fallback in dist_rust
plugins.path.join(packageDir, 'dist_rust', 'remoteingress-bin'),
// Development build paths (cargo output uses exact name)
plugins.path.join(packageDir, 'rust', 'target', 'release', 'remoteingress-bin'),
plugins.path.join(packageDir, 'rust', 'target', 'debug', 'remoteingress-bin'),
], ],
searchSystemPath: false, searchSystemPath: false,
}); });

View File

@@ -61,9 +61,13 @@ export class RemoteIngressHub extends EventEmitter {
requestTimeoutMs: 30_000, requestTimeoutMs: 30_000,
readyTimeoutMs: 10_000, readyTimeoutMs: 10_000,
localPaths: [ localPaths: [
plugins.path.join(packageDir, 'dist_rust'), // Platform-suffixed binary in dist_rust (production)
plugins.path.join(packageDir, 'rust', 'target', 'release'), plugins.path.join(packageDir, 'dist_rust', `remoteingress-bin_${process.platform === 'win32' ? 'windows' : 'linux'}_${process.arch === 'x64' ? 'amd64' : process.arch}`),
plugins.path.join(packageDir, 'rust', 'target', 'debug'), // Exact binaryName fallback in dist_rust
plugins.path.join(packageDir, 'dist_rust', 'remoteingress-bin'),
// Development build paths (cargo output uses exact name)
plugins.path.join(packageDir, 'rust', 'target', 'release', 'remoteingress-bin'),
plugins.path.join(packageDir, 'rust', 'target', 'debug', 'remoteingress-bin'),
], ],
searchSystemPath: false, searchSystemPath: false,
}); });