Решение «Client did not reuse SSL session from control channel, rejecting data connection»

Однажды я запустил ProFTPd с TLS, и пользователи успешно подключались, но один клиент пытался передавать файлы через cURL и получал ошибку:

curl --upload-file "test.txt" --ssl-reqd --ftp-create-dirs ftp://ixnfo.com:21/test/ --user test@ixnfo.com:password --insecure

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     5    0     0  100     5      0     40 --:--:-- --:--:-- --:--:--    40
curl: (18) server did not report OK, got 425

В логах ProFTPd я увидел:

SSL/TLS-P requested, starting TLS handshake
client supports secure renegotiations
TLSv1.3 connection accepted, using cipher TLS_AES_256_GCM_SHA384 (256 bits)
Protection set to Private
starting TLS negotiation on data connection
client reused SSL session for data connection
Client did not reuse SSL session from control channel, rejecting data connection (see the NoSessionReuseRequired TLSOptions parameter)
unable to open data connection: TLS negotiation failed

Потом я попробовал подключиться из Windows и MacOS, и заметил что они используют TLS 1.2, а cURL подключался с TLS 1.3.

Для решения проблемы я попробовал в команде curl добавить опцию:

--tls-max 1.2

После этого ошибка исчезла.

Эту проблему можно также решить указав NoSessionReuseRequired в конфигурации ProFTPd:

nano /etc/proftpd/tls.conf
    <IfModule mod_tls.c>
      ...
      TLSOptions NoSessionReuseRequired
      ...
    </IfModule>

Вот что я нашел об этом в официальной документации ProFTPd:

As of ProFTPD 1.3.3rc1, mod_tls only accepts SSL/TLS data connections that reuse the SSL session of the control connection, as a security measure. Unfortunately, there are some clients (e.g. curl) which do not reuse SSL sessions.

Пример логов с включенной опцией NoSessionReuseRequired при успешной передаче файла с использование cURL:

SSL/TLS-P requested, starting TLS handshake
client supports secure renegotiations
TLSv1.3 connection accepted, using cipher TLS_AES_256_GCM_SHA384 (256 bits)
Protection set to Private
starting TLS negotiation on data connection
TLSv1.3 data connection accepted, using cipher TLS_AES_256_GCM_SHA384 (256 bits)

Смотрите также мои статьи:
Настройка FTPS в ProFTPd
Как скомпилировать cURL в Ubuntu

Оставьте комментарий

Добавить комментарий

Больше на IT Blog

Оформите подписку, чтобы продолжить чтение и получить доступ к полному архиву.

Continue reading