Skip to content

✨ Add option to allow insecure TLS connections - #39

Open
Reverier-Xu wants to merge 1 commit into
masterfrom
feat/insecure-tls-option
Open

✨ Add option to allow insecure TLS connections#39
Reverier-Xu wants to merge 1 commit into
masterfrom
feat/insecure-tls-option

Conversation

@Reverier-Xu

Copy link
Copy Markdown
Member

Description

Adds a settings entry that allows ignoring insecure TLS situations: when enabled, wsrx connects to wss:// remotes without verifying the server certificate, unconditionally trusting any certificate (including self-signed, expired, or hostname-mismatched ones). The option is disabled by default.

Changes

wsrx crate (crates/wsrx/src/tunnel.rs)

  • New Tunnel::with_insecure_tls() constructor alongside the existing Tunnel::new() (which keeps full verification — CLI behavior is unchanged).
  • Implements a rustls danger::ServerCertVerifier that accepts every certificate. Signature schemes are taken from the process-wide crypto provider (AWS-LC with ring fallback).
  • Connections use connect_async_tls_with_config with a custom Connector::Rustls only when the insecure option is active.

Desktop (crates/desktop)

  • models.rs: new insecure_tls: bool field on WsrxDesktopConfig, #[serde(default)] → off by default, persisted in config.toml.
  • daemon.rs: the flag is read at launch time and threaded into tunnel creation; a warning is logged when the user enables it.
  • daemon/workers.rs: the latency-probe reqwest client follows the same certificate policy and is rebuilt when the setting changes, so probes no longer fail (and pingfall no longer drops instances) purely due to invalid certificates.
  • Settings UI: new toggle entry (default Disabled) with a danger-colored warning about man-in-the-middle attacks.
  • Connections UI: while the option is enabled, connection entries whose remote starts with wss:// display an insecure icon (ShieldError, danger color).
  • i18n: en_US / zh_CN / zh_TW strings for the new entry and warning.

Screenshots

(UI toggle + warning row; insecure icon marker on wss:// entries)

Checklist

  • cargo check --workspace --all-targets passes
  • cargo clippy — no new warnings
  • cargo fmt --check passes

Add a settings entry that lets the user disable TLS certificate
verification, unconditionally trusting any server certificate when
connecting to wss:// remotes.

- wsrx tunnel: new `with_insecure_tls` constructor using a custom
  rustls danger verifier (`Connector::Rustls`); the default `new`
  keeps full verification and the CLI behavior is unchanged.
- desktop config: persist `insecure_tls` in config.toml, disabled by
  default; thread the flag through instance launching.
- latency probe: rebuild the reqwest client when the setting changes so
  probes follow the same certificate policy as tunnels (avoids pingfall
  dropping instances over certificate errors).
- settings UI: toggle entry (default off) with a danger-colored warning
  about man-in-the-middle risks.
- connections UI: mark wss:// entries with an insecure icon while the
  option is enabled.
- i18n: en_US / zh_CN / zh_TW strings for the new entry and warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant