Created Protocol Encryption Configuration (markdown)

Jari Sundell
2026-07-14 21:01:04 +09:00
parent 36141f6d6c
commit caccfec676
+68
@@ -0,0 +1,68 @@
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
```libtorrent
protocol.encryption.set = <policy>
```
*Or with explicit sub-settings:*
```libtorrent
protocol.encryption.set = handshake_<policy>, stream_<policy>
```
#### 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.
```libtorrent
protocol.encryption.set = prefer
```
### Example 2: Strict/Forced Encryption
This configuration completely disables unencrypted traffic. It will block all incoming and outgoing connections that do not support encryption.
```libtorrent
protocol.encryption.set = require
```
### 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.
```libtorrent
protocol.encryption.set = handshake_require, stream_prefer
```