Overview of Commands
The encryption policy applies separately to handshake and (full) message stream behavior, and applies the same policy to both incoming and outgoing connections.
| Command |
Description |
protocol.encryption |
Returns the current handshake and stream encryption settings. |
protocol.encryption.set |
Configures global encryption policies using legacy or unified strings. |
protocol.encryption.handshake |
Returns the current handshake encryption settings. |
protocol.encryption.stream |
Returns the current handshake encryption settings. |
Configuration Methods
You can configure encryption in rTorrent using either a unified command or by configuring the handshake and stream behaviors individually.
Default is allow, which defaults to plaintext while allowing encrypted handshake and message stream
Or with explicit sub-settings:
Available Policies
deny: Disables encryption.
allow: Allows encrypted connections if initiated by the peer, but prefers unencrypted.
prefer: Attempts to use encryption by default, but falls back to unencrypted if the peer does not support it.
require: Forcefully requires encryption. Connections with peers that do not support encryption will be dropped.
Configuration Examples
Add these to your ~/.rtorrent.rc configuration file.
Example 1: Standard Encryption (Highly Compatible)
This configuration prefers encryption for both handshakes and data streams, but will fall back to plaintext to maintain high peer availability.
Example 2: Strict/Forced Encryption
This configuration completely disables unencrypted traffic. It will block all incoming and outgoing connections that do not support encryption.
Example 3: Mixed/Asymmetric Setup
In this setup, you require an encrypted handshake to establish the connection, but allow the actual message stream to fall back to unencrypted if necessary.