From c4ac6969193aeebbb52477f1187face4048fb26b Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 13 Apr 2026 21:32:04 +0300 Subject: [PATCH] Update documentation for parent tcps/https/etc --- doc/html/howtoe.html | 23 +++++++++++++++++++++++ doc/html/howtor.html | 23 +++++++++++++++++++++++ doc/html/plugins/SSLPlugin.html | 22 +++++++++++++++++++++- doc/html/plugins/SSLPlugin.ru.html | 22 +++++++++++++++++++++- 4 files changed, 88 insertions(+), 2 deletions(-) diff --git a/doc/html/howtoe.html b/doc/html/howtoe.html index dfca84c..f16009c 100644 --- a/doc/html/howtoe.html +++ b/doc/html/howtoe.html @@ -711,6 +711,29 @@ ssl_client_ca_file /etc/ssl/certs/ca-certificates.crt ssl_cli proxy -p3128 +

+Conditional TLS for parent proxy (ssl_client_mode 3): +
With ssl_client_mode 3, TLS handshake to parent proxy is performed only if the parent type ends with 's' (secure types). This allows mixing secure and non-secure parent proxies in the same configuration: +

+plugin /path/to/SSLPlugin.ld.so ssl_plugin
+ssl_server_cert /etc/3proxy/certs/server.crt
+ssl_server_key /etc/3proxy/certs/server.key
+ssl_client_mode 3
+
+auth strong
+allow user1
+parent 1000 https parent1.example.com 443
+allow user2
+parent 1000 socks5 parent2.example.com 1080
+ssl_serv
+ssl_cli
+proxy -p3128
+ssl_noserv
+ssl_nocli
+
+

+This creates an HTTPS proxy (ssl_serv) that accepts TLS connections from clients. For parent proxy connections, user1's traffic goes through an https parent with TLS encryption (secure type), while user2's traffic goes through a regular socks5 parent without TLS. Secure parent types include: tcps, https, connects, connect+s, socks4s, socks5s, socks4+s, socks5+s, pop3s, smtps, ftps. +

  • How to create CA and certificates for SSLPlugin

    Creating a Certificate Authority (CA): diff --git a/doc/html/howtor.html b/doc/html/howtor.html index 3cbec6b..30a09c0 100644 --- a/doc/html/howtor.html +++ b/doc/html/howtor.html @@ -720,6 +720,29 @@ ssl_client_ca_file /etc/ssl/certs/ca-certificates.crt ssl_cli proxy -p3128 +

    +Условное TLS для parent прокси (ssl_client_mode 3): +
    При ssl_client_mode 3 TLS-рукопожатие с родительским прокси выполняется только если тип parent прокси заканчивается на 's' (защищённые типы). Это позволяет смешивать защищённые и незащищённые родительские прокси в одной конфигурации: +

    +plugin /path/to/SSLPlugin.ld.so ssl_plugin
    +ssl_server_cert /etc/3proxy/certs/server.crt
    +ssl_server_key /etc/3proxy/certs/server.key
    +ssl_client_mode 3
    +
    +auth strong
    +allow user1
    +parent 1000 https parent1.example.com 443
    +allow user2
    +parent 1000 socks5 parent2.example.com 1080
    +ssl_serv
    +ssl_cli
    +proxy -p3128
    +ssl_noserv
    +ssl_nocli
    +
    +

    +Создаётся HTTPS-прокси (ssl_serv), принимающий TLS-соединения от клиентов. Для соединений с родительским прокси трафик user1 идёт через https родитель с TLS-шифрованием (защищённый тип), а трафик user2 — через обычный socks5 родитель без TLS. Защищённые типы parent прокси: tcps, https, connects, connect+s, socks4s, socks5s, socks4+s, socks5+s, pop3s, smtps, ftps. +

  • Как создать CA и сертификаты для SSLPlugin

    Создание удостоверяющего центра (CA): diff --git a/doc/html/plugins/SSLPlugin.html b/doc/html/plugins/SSLPlugin.html index 24f25f6..89e5582 100644 --- a/doc/html/plugins/SSLPlugin.html +++ b/doc/html/plugins/SSLPlugin.html @@ -44,7 +44,7 @@ ssl_cli (or ssl_client) - establish TLS connection to upstream server for servic
    ssl_client_ca_store /path/to/castore - CA store for ssl_client_verify (OpenSSL 3.0+)
    ssl_client_sni hostname - SNI hostname to send to upstream server (overrides the requested hostname)
    ssl_client_alpn protocol1 protocol2 ... - ALPN protocols to negotiate with upstream server (e.g., ssl_client_alpn h2 http/1.1) -
    ssl_client_mode mode - when to establish TLS connection: 0 - on connect (default), 1 - after authentication, 2 - before data +
    ssl_client_mode mode - when to establish TLS connection: 0 - on connect (default), 1 - after authentication, 2 - before data, 3 - only for secure parent types (ending with 's')
    ssl_certcache /path/to/cache/ - location for the generated MITM certificates cache, optional if ssl_server_ca_file / ssl_server_ca_key are configured. The cache may contain 3 files: 3proxy.pem - public self-signed certificates (used if ssl_server_ca_file is not configured), @@ -89,6 +89,26 @@ proxy -p3128 Creates an HTTP proxy that connects to upstream servers via TLS with client certificate authentication. +

    Conditional TLS for parent proxy (ssl_client_mode 3):

    +
    +plugin /path/to/SSLPlugin.so ssl_plugin
    +ssl_server_cert /path/to/server.crt
    +ssl_server_key /path/to/key
    +ssl_client_mode 3
    +
    +auth strong
    +allow user1
    +parent 1000 https parent1.example.com 443
    +allow user2
    +parent 1000 socks5 parent2.example.com 1080
    +ssl_serv
    +ssl_cli
    +proxy -p3128
    +ssl_noserv
    +ssl_nocli
    +
    +Creates an HTTP proxy on port 3128 that uses TLS for client connections (ssl_serv). With ssl_client_mode 3, TLS handshake to parent proxy is performed only if the parent type ends with 's' (secure types). In this example, user1's traffic goes through an https parent proxy with TLS encryption, while user2's traffic goes through a regular socks5 parent without TLS. Secure parent types include: tcps, https, connects, connect+s, socks4s, socks5s, socks4+s, socks5+s, pop3s, smtps, ftps. +

    mTLS example (require client certificate):

     plugin /path/to/SSLPlugin.so ssl_plugin
    diff --git a/doc/html/plugins/SSLPlugin.ru.html b/doc/html/plugins/SSLPlugin.ru.html
    index 06e3790..7c6bf6b 100644
    --- a/doc/html/plugins/SSLPlugin.ru.html
    +++ b/doc/html/plugins/SSLPlugin.ru.html
    @@ -44,7 +44,7 @@ ssl_cli (или ssl_client) - устанавливать TLS-соединени
     
    ssl_client_ca_store /path/to/castore - хранилище CA-сертификатов для ssl_client_verify (OpenSSL 3.0+)
    ssl_client_sni hostname - SNI-имя хоста для отправки вышестоящему серверу (переопределяет запрошенное имя хоста)
    ssl_client_alpn протокол1 протокол2 ... - ALPN-протоколы для согласования с вышестоящим сервером (например, ssl_client_alpn h2 http/1.1) -
    ssl_client_mode режим - когда устанавливать TLS-соединение: 0 - при подключении (по умолчанию), 1 - после аутентификации, 2 - перед передачей данных +
    ssl_client_mode режим - когда устанавливать TLS-соединение: 0 - при подключении (по умолчанию), 1 - после аутентификации, 2 - перед передачей данных, 3 - только для защищённых типов parent прокси (заканчивающихся на 's')
    ssl_certcache /path/to/cache/ - расположение кеша сгенерированных MITM-сертификатов. Кеш может содержать файлы 3proxy.pem, 3proxy.key, server.key, которые используются как ssl_server_ca_file, ssl_server_ca_key и ssl_server_key соответственно, если они не заданы. Если server.key не задан, @@ -86,6 +86,26 @@ proxy -p3128
    Создается HTTP-прокси, который соединяется с вышестоящими серверами через TLS с аутентификацией по клиентскому сертификату. +

    Условное TLS для parent прокси (ssl_client_mode 3):

    +
    +plugin /path/to/SSLPlugin.so ssl_plugin
    +ssl_server_cert /path/to/server.crt
    +ssl_server_key /path/to/key
    +ssl_client_mode 3
    +
    +auth strong
    +allow user1
    +parent 1000 https parent1.example.com 443
    +allow user2
    +parent 1000 socks5 parent2.example.com 1080
    +ssl_serv
    +ssl_cli
    +proxy -p3128
    +ssl_noserv
    +ssl_nocli
    +
    +Создается HTTP-прокси на порту 3128, использующий TLS для клиентских соединений (ssl_serv). При ssl_client_mode 3 TLS-рукопожатие с родительским прокси выполняется только если тип parent прокси заканчивается на 's' (защищённые типы). В данном примере трафик user1 идёт через https родительский прокси с TLS-шифрованием, а трафик user2 — через обычный socks5 родитель без TLS. Защищённые типы parent прокси: tcps, https, connects, connect+s, socks4s, socks5s, socks4+s, socks5+s, pop3s, smtps, ftps. +

    Пример mTLS (требование клиентского сертификата):

     plugin /path/to/SSLPlugin.so ssl_plugin