Skip to content

Conversation

google-labs-jules[bot]
Copy link

This patch implements TLS encryption for the control channel connection between the uniqx client and server.

Key changes:

  • Server: Added --cert and --key flags to load a TLS certificate and private key, enabling the server to accept secure connections.
  • Client: Added a --tls flag to initiate a TLS connection and an --insecure flag to bypass certificate verification for development purposes.
  • Implementation: Used rustls and tokio-rustls for the TLS logic. A SecureStream enum was implemented to transparently handle both plain TCP and TLS streams in the connection logic for both the client and server.
  • Tests: The existing integration tests were updated to reflect the new arguments in the client and server constructors.

This change adds TLS encryption to the control connection between the `uniqx` client and server, enhancing the security of the tunnel.

The server can now be configured to use TLS by providing a certificate and a private key using the `--cert` and `--key` command-line arguments.

The client can enable TLS for its connection using the `--tls` flag. For development and testing purposes, an `--insecure` flag has also been added to allow the client to connect to servers using self-signed certificates.

This implementation uses the `rustls` and `tokio-rustls` crates. The existing integration tests have been updated to accommodate the new function signatures.
Add the `description`, `license`, `repository`, and `authors` fields to the `Cargo.toml` files for the `shared`, `client`, and `server` crates.

This metadata is required to publish these crates to `crates.io` as part of the workspace.
This change introduces a `--ca-cert` flag for the client. This flag allows a user to specify a path to a custom Certificate Authority (CA) certificate file. The client will use this certificate to verify the server's TLS certificate.

This provides a secure alternative to the `--insecure` flag when connecting to a server that uses a self-signed certificate. Instead of disabling validation entirely, the client can be told to trust a specific, known certificate.

The `README.md` has also been updated to document this new feature and recommend it as the preferred method for handling self-signed certificates.
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.

0 participants