<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Рутокен &mdash; Рутокен ЭЦП 2.0 + stunnel]]></title>
		<link>https://forum.rutoken.ru/topic/3651/</link>
		<atom:link href="https://forum.rutoken.ru/feed/rss/topic/3651/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Рутокен ЭЦП 2.0 + stunnel».]]></description>
		<lastBuildDate>Fri, 05 Aug 2022 13:08:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18059/#p18059</link>
			<description><![CDATA[<p>Если вы используете сертификат и ключи формата ГОСТ, то использовать pkcs11.so не получится. <br />Необходимо все-таки использовать rtengine.<br />Второй момент, у вас указано где взять сертификат, но закомментирована строка с ключем.</p>]]></description>
			<author><![CDATA[null@example.com (Аверченко Кирилл)]]></author>
			<pubDate>Fri, 05 Aug 2022 13:08:50 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18059/#p18059</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18057/#p18057</link>
			<description><![CDATA[<p>Есть некоторые подвижки.</p><p>Немного изменил файл <strong>stunnel.conf:</strong></p><div class="codebox"><pre><code>; уровень логирования и путь до лог-файла
debug = 7
output = /var/lib/stunnel4/stunnel.log

; устанавливаем протокол защиты TLSv1.2
sslVersion=TLSv1.1

; подгружаем движок
engine = pkcs11
engineCtrl = MODULE_PATH:/usr/lib/librtpkcs11ecp.so

fips = no

; настраиваем туннель на клиенте
[https]
; указываем engine, необходимый для подгрузки ключей
engineId = pkcs11

; устанавливаем верификацию 2 (принудительную проверку сертификата)
verify = 2
; путь до корневого сертификата
CAFile = /etc/stunnel/CA-SIT_2022.pem
; путь до сертификата клиента
cert = pkcs11:model=Rutoken%20ECP?pin-value=12345678

; путь до ключа на токене.
; key = pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7
; key = pkcs11:id=7837865CFAD361E58A23474F42185EE4848DA2F2
options = NO_SSLv2


client = yes
accept = 127.0.0.1:8000
connect = sit01.dom.test.gosuslugi.ru:10082</code></pre></div><p>Вывод при запуске тоже поменялся:<br /></p><div class="codebox"><pre><code>No private keys found.
PKCS11_get_private_key returned NULL
[ ] Clients allowed=500
[.] stunnel 5.56 on x86_64-pc-linux-gnu platform
[.] Compiled with OpenSSL 1.1.1c  28 May 2019
[.] Running  with OpenSSL 1.1.1f  31 Mar 2020
[.] Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
[ ] errno: (*__errno_location ())
[.] Reading configuration from file /etc/stunnel/stunnel.conf
[.] UTF-8 byte order mark not detected
[ ] Enabling support for engine &quot;pkcs11&quot;
[.] UI set for engine #1 (pkcs11)
[ ] Executing engine control command MODULE_PATH:/usr/lib/librtpkcs11ecp.so
[ ] Initializing engine #1 (pkcs11)
[ ] Engine #1 (pkcs11) initialized
[.] FIPS mode disabled
[ ] Compression disabled
[ ] No PRNG seeding was required
[ ] Initializing service [https]
[ ] Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK
[ ] TLSv1.3 ciphersuites: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
[ ] TLS options: 0x02100004 (+0x00000000, -0x00000000)
[ ] Client certificate engine (pkcs11) not supported
[ ] Loading certificate from engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
[ ] Certificate loaded from engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
[ ] Initializing private key on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
[!] error queue: ../crypto/engine/eng_pkey.c:77: error:26096080:engine routines:ENGINE_load_private_key:failed loading private key
[!] ENGINE_load_private_key: eng_back.c:858: error:82067065:pkcs11 engine:ctx_load_privkey:object not found
[ ] Loading private key from file: pkcs11:model=Rutoken%20ECP?pin-value=12345678
[!] pkcs11:model=Rutoken%20ECP?pin-value=12345678: No such file or directory (2)
[!] Service [https]: Failed to initialize TLS context
[ ] Deallocating section defaults</code></pre></div><p>Теперь не находит только приватный ключ.</p><p><strong>openssl.cnf</strong> теперь такой:<br /></p><div class="codebox"><pre><code>[openssl_def]
engines = engine_section

[engine_section]
rtengine = gost_section
pkcs11 = pkcs11_section

[gost_section]
engine_id = rtengine
dynamic_path = /usr/lib/x86_64-linux-gnu/librtengine.so
pkcs11_path = /usr/lib/librtpkcs11ecp.so
rand_token = pkcs11:model=Rutoken%20ECP?pin-value=12345678
default_algorithms = CIPHERS, DIGEST, PKEY, RAND
enable_rand = yes

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
MODULE_PATH = /usr/lib/librtpkcs11ecp.so
default_algorithms = CIPHERS, DIGEST, PKEY, RAND</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Fri, 05 Aug 2022 11:57:08 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18057/#p18057</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18049/#p18049</link>
			<description><![CDATA[<div class="quotebox"><cite>Аверченко Кирилл пишет:</cite><blockquote><p>Тогда странно, что в логе подключения есть информация про TLS 1.3. Может быть сервер не поддерживает такое подключение?<br />Есть возможность проверить установку соединения с ключем не на токене, а в файле?</p><p>Так же, можно для проверки, что сам stunnel работает корректно, проверить соединение с тестовыми серверами КриптоПро по инструкции <a href="https://habr.com/ru/company/aktiv-company/blog/477650/">https://habr.com/ru/company/aktiv-company/blog/477650/</a></p></blockquote></div><p>Да я тоже видел TLS 1.3 и никак не могу понять откуда он берётся.<br />К сожалению у нас не выгружаемый контейнер.<br />А вот всё остальное проверить можно.<br />Так же хочу проверить на чистой системе, чтобы небыло установки криптопро и stunnel от криптопро.</p>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Fri, 05 Aug 2022 06:19:43 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18049/#p18049</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18043/#p18043</link>
			<description><![CDATA[<div class="quotebox"><cite>vanobl пишет:</cite><blockquote><p>Но этот параметр уже есть в конфиге.</p></blockquote></div><p>Тогда странно, что в логе подключения есть информация про TLS 1.3. Может быть сервер не поддерживает такое подключение?<br />Есть возможность проверить установку соединения с ключем не на токене, а в файле?</p><p>Так же, можно для проверки, что сам stunnel работает корректно, проверить соединение с тестовыми серверами КриптоПро по инструкции <a href="https://habr.com/ru/company/aktiv-company/blog/477650/">https://habr.com/ru/company/aktiv-company/blog/477650/</a></p>]]></description>
			<author><![CDATA[null@example.com (Аверченко Кирилл)]]></author>
			<pubDate>Thu, 04 Aug 2022 11:56:55 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18043/#p18043</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18042/#p18042</link>
			<description><![CDATA[<p>Кирилл, спасибо! Но этот параметр уже есть в конфиге.<br />Буду пробовать всё накатить на чистую систему, может дело в этом...</p>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Thu, 04 Aug 2022 11:44:37 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18042/#p18042</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18041/#p18041</link>
			<description><![CDATA[<p>Можете попробовать в конфиге stunnel поменять версию протокола TLS:<br />sslVersion=TLSv1 или TLSv1.1</p>]]></description>
			<author><![CDATA[null@example.com (Аверченко Кирилл)]]></author>
			<pubDate>Thu, 04 Aug 2022 10:13:08 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18041/#p18041</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18034/#p18034</link>
			<description><![CDATA[<p><strong>Кирилл</strong>, здравствуйте!</p><p>Изменения не помогли.</p><p><strong>openssl.cnf</strong> теперь такой (закоментированы неудачные пробы :))<br /></p><div class="codebox"><pre><code>[engine_section]
rtengine = gost_section

[gost_section]
engine_id = rtengine
dynamic_path = /usr/lib/x86_64-linux-gnu/librtengine.so
pkcs11_path = /usr/lib/librtpkcs11ecp.so
# rand_token = pkcs11:model=Rutoken%20ECP;object=67b77c19-2098-4892-944f-256813baaf0a?pin-value=12345678
rand_token = pkcs11:model=Rutoken%20ECP;id=0477dda5f69dfb917a512ff03460557567690ab7?pin-value=12345678
default_algorithms = CIPHERS, DIGEST, PKEY, RAND
enable_rand = yes
# MinProtocol = TLSv1
# CipherString = DEFAULT:@SECLEVEL=1</code></pre></div><p><strong>stunnel.log</strong><br /></p><div class="codebox"><pre><code>2022.08.03 17:22:27 LOG5[main]: Terminatedwed=500
2022.08.03 17:21:45 LOG5[ui]: stunnel 5.56 on x86_64-pc-linux-gnu platform
2022.08.03 17:21:45 LOG5[ui]: Compiled with OpenSSL 1.1.1c  28 May 2019
2022.08.03 17:21:45 LOG5[ui]: Running  with OpenSSL 1.1.1f  31 Mar 2020
2022.08.03 17:21:45 LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
2022.08.03 17:21:45 LOG7[ui]: errno: (*__errno_location ())
2022.08.03 17:21:45 LOG5[ui]: Reading configuration from file /etc/stunnel/stunnel.conf
2022.08.03 17:21:45 LOG5[ui]: UTF-8 byte order mark not detected
2022.08.03 17:21:45 LOG7[ui]: Enabling support for engine &quot;rtengine&quot;
2022.08.03 17:21:45 LOG6[ui]: UI not supported by engine #1 (rtengine)
2022.08.03 17:21:45 LOG7[ui]: Initializing engine #1 (rtengine)
2022.08.03 17:21:45 LOG6[ui]: Engine #1 (rtengine) initialized
2022.08.03 17:21:45 LOG5[ui]: FIPS mode disabled
2022.08.03 17:21:45 LOG7[ui]: Compression disabled
2022.08.03 17:21:45 LOG7[ui]: No PRNG seeding was required
2022.08.03 17:21:45 LOG6[ui]: Initializing service [https]
2022.08.03 17:21:46 LOG7[ui]: Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK
2022.08.03 17:21:46 LOG7[ui]: TLSv1.3 ciphersuites: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
2022.08.03 17:21:46 LOG7[ui]: TLS options: 0x02100004 (+0x00000000, -0x00000000)
2022.08.03 17:21:46 LOG6[ui]: Client certificate engine (rtengine) not supported
2022.08.03 17:21:46 LOG6[ui]: Loading certificate from engine ID: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 17:21:46 LOG3[ui]: ENGINE_ctrl_cmd: Peer suddenly disconnected
2022.08.03 17:21:46 LOG6[ui]: Initializing private key on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
2022.08.03 17:21:48 LOG6[ui]: Private key initialized on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
2022.08.03 17:21:48 LOG6[ui]: Loading certificate from file: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 17:21:48 LOG6[ui]: Certificate loaded from file: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 17:21:48 LOG7[ui]: Private key check succeeded
2022.08.03 17:21:48 LOG4[ui]: Service [https] needs authentication to prevent MITM attacks
2022.08.03 17:21:48 LOG5[ui]: Configuration successful
2022.08.03 17:21:48 LOG7[ui]: Binding service [https]
2022.08.03 17:21:48 LOG7[ui]: Listening file descriptor created (FD=10)
2022.08.03 17:21:48 LOG7[ui]: Setting accept socket options (FD=10)
2022.08.03 17:21:48 LOG7[ui]: Option SO_REUSEADDR set on accept socket
2022.08.03 17:21:48 LOG6[ui]: Service [https] (FD=10) bound to 127.0.0.1:8000
2022.08.03 17:21:48 LOG7[main]: Created pid file /home/tester/stunnel_cli_pid.pid
2022.08.03 17:21:48 LOG7[cron]: Cron thread initialized
2022.08.03 17:21:48 LOG6[cron]: Executing cron jobs
2022.08.03 17:21:48 LOG6[cron]: Cron jobs completed in 0 seconds
2022.08.03 17:21:48 LOG7[cron]: Waiting 86400 seconds
2022.08.03 17:22:02 LOG7[main]: Found 1 ready file descriptor(s)
2022.08.03 17:22:02 LOG7[main]: FD=5 events=0x2001 revents=0x0
2022.08.03 17:22:02 LOG7[main]: FD=10 events=0x2001 revents=0x1
2022.08.03 17:22:02 LOG7[main]: Service [https] accepted (FD=3) from 127.0.0.1:43420
2022.08.03 17:22:02 LOG7[0]: Service [https] started
2022.08.03 17:22:02 LOG7[0]: Setting local socket options (FD=3)
2022.08.03 17:22:02 LOG7[0]: Option TCP_NODELAY set on local socket
2022.08.03 17:22:02 LOG5[0]: Service [https] accepted connection from 127.0.0.1:43420
2022.08.03 17:22:02 LOG6[0]: s_connect: connecting 217.107.108.147:10082
2022.08.03 17:22:02 LOG7[0]: s_connect: s_poll_wait 217.107.108.147:10082: waiting 10 seconds
2022.08.03 17:22:02 LOG7[0]: FD=7 events=0x2001 revents=0x0
2022.08.03 17:22:02 LOG7[0]: FD=12 events=0x2005 revents=0x0
2022.08.03 17:22:02 LOG5[0]: s_connect: connected 217.107.108.147:10082
2022.08.03 17:22:02 LOG5[0]: Service [https] connected remote server from 192.168.1.3:47534
2022.08.03 17:22:02 LOG7[0]: Setting remote socket options (FD=12)
2022.08.03 17:22:02 LOG7[0]: Option TCP_NODELAY set on remote socket
2022.08.03 17:22:02 LOG7[0]: Remote descriptor (FD=12) initialized
2022.08.03 17:22:02 LOG6[0]: SNI: sending servername: sit01.dom.test.gosuslugi.ru
2022.08.03 17:22:02 LOG6[0]: Peer certificate not required
2022.08.03 17:22:02 LOG7[0]: TLS state (connect): before SSL initialization
2022.08.03 17:22:02 LOG7[0]: TLS alert (write): fatal: internal error
2022.08.03 17:22:02 LOG3[0]: SSL_connect: ../ssl/statem/statem_clnt.c:1112: error:141E70BF:SSL routines:tls_construct_client_hello:no protocols availa&gt;2022.08.03 17:22:02 LOG5[0]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
2022.08.03 17:22:02 LOG7[0]: Remote descriptor (FD=12) closed
2022.08.03 17:22:02 LOG7[0]: Local descriptor (FD=3) closed
2022.08.03 17:22:02 LOG7[0]: Service [https] finished (0 left)
2022.08.03 17:22:27 LOG7[main]: Found 1 ready file descriptor(s)
2022.08.03 17:22:27 LOG7[main]: FD=5 events=0x2001 revents=0x1
2022.08.03 17:22:27 LOG7[main]: FD=10 events=0x2001 revents=0x0
2022.08.03 17:22:27 LOG7[main]: Dispatching a signal from the signal pipe
2022.08.03 17:22:27 LOG7[main]: Processing SIGNAL_TERMINATE
2022.08.03 17:22:27 LOG5[main]: Terminated
2022.08.03 17:22:27 LOG7[main]: Leak detection table utilization: 40/997, 4.01%
2022.08.03 17:22:27 LOG7[main]: Removed pid file /home/tester/stunnel_cli_pid.pid
2022.08.03 17:22:27 LOG7[main]: Terminating the cron thread</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Wed, 03 Aug 2022 14:30:02 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18034/#p18034</guid>
		</item>
		<item>
			<title><![CDATA[Re: Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18029/#p18029</link>
			<description><![CDATA[<p><strong>vanobl</strong>, добрый день.<br />Вам либо необходимо в конфиге openssl либо раскомментировать строку rand_token с указанием серийного номера токена, либо закомментировать строку enable_rand = yes</p>]]></description>
			<author><![CDATA[null@example.com (Аверченко Кирилл)]]></author>
			<pubDate>Wed, 03 Aug 2022 12:03:21 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18029/#p18029</guid>
		</item>
		<item>
			<title><![CDATA[Рутокен ЭЦП 2.0 + stunnel]]></title>
			<link>https://forum.rutoken.ru/post/18027/#p18027</link>
			<description><![CDATA[<p>OS = Ubuntu Server 22.04<br />token = Рутокен ЭЦП 2.0<br />openssl = OpenSSL 1.1.1f<br />stunnel = stunnel 5.56</p><p>Для настройки использовалась <a href="https://dev.rutoken.ru/pages/viewpage.action?pageId=72451592">статья </a>. Но с настройками openssl из статьи stunnel вообще не стартует. С настройками <a href="https://dev.rutoken.ru/pages/viewpage.action?pageId=89096210"> этой статьи</a> stunnel стартует, процесс висит, но не работает.</p><p>Мои настройки такие:<br /><strong>openssl.cnf:</strong><br /></p><div class="codebox"><pre><code>openssl_conf = openssl_def
*******
[openssl_def]
engines = engine_section

[engine_section]
rtengine = gost_section
pkcs11 = pkcs11_section

[gost_section]
engine_id = rtengine
dynamic_path = /usr/lib/x86_64-linux-gnu/librtengine.so
pkcs11_path = /usr/lib/librtpkcs11ecp.so
# rand_token = pkcs11:manufacturer=Aktiv%20Co.;model=Rutoken%20ECP;id=048883ad0cce9ce51ea7206c8f7d629a6bfdeb22
rand_token = pkcs11:model=Rutoken%20ECP?pin-value=12345678
default_algorithms = CIPHERS, DIGEST, PKEY, RAND
enable_rand = yes

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
MODULE_PATH = /usr/lib/librtpkcs11ecp.so
default_algorithms = CIPHERS, DIGEST, PKEY, RAND</code></pre></div><p><strong>stunnel.conf:</strong><br /></p><div class="codebox"><pre><code>; уровень логирования и путь до лог-файла
debug = 7
output = /home/tester/stunnel.log
pid = /home/tester/stunnel_cli_pid.pid

; устанавливаем протокол защиты TLSv1
sslVersion = TLSv1.1
; sslVersion = all
; подгружаем движок
engine = rtengine
; engine = pkcs11
[https]
engineId = rtengine
; engineId = pkcs11

client = yes
accept = 127.0.0.1:8000
connect = sit01.dom.test.gosuslugi.ru:10082

; путь до корневого сертификата
CAFile = /etc/stunnel/CA-SIT_2022.pem
checkHost = yes

; путь до сертификата клиента
; cert=pkcs11:model=Rutoken%20ECP?pin-value=12345678
; cert=pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7
cert = /home/tester/my_certs/rezonans_new_base64.cer

; путь до ключа на токене.
key=pkcs11:model=Rutoken%20ECP?pin-value=12345678
; key=pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7
options = NO_SSLv2

; устанавливаем верификацию
verify = 2</code></pre></div><p><strong>stunnel.log:</strong><br /></p><div class="codebox"><pre><code>2022.08.03 14:18:25 LOG7[ui]: Clients allowed=500
2022.08.03 14:18:25 LOG5[ui]: stunnel 5.56 on x86_64-pc-linux-gnu platform
2022.08.03 14:18:25 LOG5[ui]: Compiled with OpenSSL 1.1.1c  28 May 2019
2022.08.03 14:18:25 LOG5[ui]: Running  with OpenSSL 1.1.1f  31 Mar 2020
2022.08.03 14:18:25 LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
2022.08.03 14:18:25 LOG7[ui]: errno: (*__errno_location ())
2022.08.03 14:18:25 LOG5[ui]: Reading configuration from file /etc/stunnel/stunnel.conf
2022.08.03 14:18:25 LOG5[ui]: UTF-8 byte order mark not detected
2022.08.03 14:18:25 LOG7[ui]: Enabling support for engine &quot;rtengine&quot;
2022.08.03 14:18:25 LOG6[ui]: UI not supported by engine #1 (rtengine)
2022.08.03 14:18:25 LOG7[ui]: Initializing engine #1 (rtengine)
2022.08.03 14:18:25 LOG6[ui]: Engine #1 (rtengine) initialized
2022.08.03 14:18:25 LOG5[ui]: FIPS mode disabled
2022.08.03 14:18:25 LOG7[ui]: Compression disabled
2022.08.03 14:18:25 LOG7[ui]: No PRNG seeding was required
2022.08.03 14:18:25 LOG6[ui]: Initializing service [https]
2022.08.03 14:18:26 LOG7[ui]: Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK
2022.08.03 14:18:26 LOG7[ui]: TLSv1.3 ciphersuites: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM&gt;2022.08.03 14:18:26 LOG7[ui]: TLS options: 0x02100004 (+0x00000000, -0x00000000)
2022.08.03 14:18:26 LOG6[ui]: Client certificate engine (rtengine) not supported
2022.08.03 14:18:26 LOG6[ui]: Loading certificate from engine ID: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 14:18:26 LOG3[ui]: ENGINE_ctrl_cmd: Peer suddenly disconnected
2022.08.03 14:18:26 LOG6[ui]: Initializing private key on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
2022.08.03 14:18:28 LOG6[ui]: Private key initialized on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
2022.08.03 14:18:28 LOG6[ui]: Loading certificate from file: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 14:18:28 LOG6[ui]: Certificate loaded from file: /home/tester/my_certs/rezonans_new_base64.cer
2022.08.03 14:18:28 LOG7[ui]: Private key check succeeded
2022.08.03 14:18:28 LOG5[ui]: Configuration successful
2022.08.03 14:18:28 LOG7[ui]: Binding service [https]
2022.08.03 14:18:28 LOG7[ui]: Listening file descriptor created (FD=10)
2022.08.03 14:18:28 LOG7[ui]: Setting accept socket options (FD=10)
2022.08.03 14:18:28 LOG7[ui]: Option SO_REUSEADDR set on accept socket
2022.08.03 14:18:28 LOG6[ui]: Service [https] (FD=10) bound to 127.0.0.1:8000
2022.08.03 14:18:28 LOG7[main]: Created pid file /home/tester/stunnel_cli_pid.pid
2022.08.03 14:18:28 LOG7[cron]: Cron thread initialized
2022.08.03 14:18:28 LOG6[cron]: Executing cron jobs
2022.08.03 14:18:28 LOG6[cron]: Cron jobs completed in 0 seconds
2022.08.03 14:18:28 LOG7[cron]: Waiting 86400 seconds
2022.08.03 14:18:49 LOG7[main]: Found 1 ready file descriptor(s)
2022.08.03 14:18:49 LOG7[main]: FD=5 events=0x2001 revents=0x1
2022.08.03 14:18:49 LOG7[main]: FD=10 events=0x2001 revents=0x0
2022.08.03 14:18:49 LOG7[main]: Dispatching a signal from the signal pipe
2022.08.03 14:18:49 LOG7[main]: Processing SIGNAL_TERMINATE
2022.08.03 14:18:49 LOG5[main]: Terminated
2022.08.03 14:18:49 LOG7[main]: Leak detection table utilization: 13/997, 1.30%
2022.08.03 14:18:49 LOG7[main]: Removed pid file /home/tester/stunnel_cli_pid.pid
2022.08.03 14:18:49 LOG7[main]: Terminating the cron thread
2022.08.03 14:18:49 LOG5[main]: Terminating 1 service thread(s)
2022.08.03 14:18:49 LOG5[main]: Service threads terminated
2022.08.03 14:18:49 LOG7[main]: Deallocating section defaults</code></pre></div><p>Подскажите, пожалуйста, в чём может быть проблема?</p><p>Если в <strong>stunnel.conf</strong> вызвать движок <strong>pkcs11</strong>, а так же параметр <strong>cert</strong> сделать:<br /><strong>pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7</strong></p><p>Тогда при попытке запуска stunnel вывод будет таким:<br /></p><div class="codebox"><pre><code>Specified object not found
Specified object not found
Specified object not found
PKCS11_get_private_key returned NULL
[ ] Clients allowed=500
[.] stunnel 5.56 on x86_64-pc-linux-gnu platform
[.] Compiled with OpenSSL 1.1.1c  28 May 2019
[.] Running  with OpenSSL 1.1.1f  31 Mar 2020
[.] Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
[ ] errno: (*__errno_location ())
[.] Reading configuration from file /etc/stunnel/stunnel.conf
[.] UTF-8 byte order mark not detected
[ ] Enabling support for engine &quot;pkcs11&quot;
[.] UI set for engine #1 (pkcs11)
[ ] Initializing engine #1 (pkcs11)
[ ] Engine #1 (pkcs11) initialized
[.] FIPS mode disabled
[ ] Compression disabled
[ ] No PRNG seeding was required
[ ] Initializing service [https]
[ ] Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK
[ ] TLSv1.3 ciphersuites: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
[ ] TLS options: 0x02100004 (+0x00000000, -0x00000000)
[ ] Client certificate engine (pkcs11) not supported
[ ] Loading certificate from engine ID: pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7
[!] ENGINE_ctrl_cmd: eng_back.c:593: error:82066065:pkcs11 engine:ctx_ctrl_load_cert:object not found
[ ] Initializing private key on engine ID: pkcs11:model=Rutoken%20ECP?pin-value=12345678
[!] error queue: ../crypto/engine/eng_pkey.c:77: error:26096080:engine routines:ENGINE_load_private_key:failed loading private key
[!] ENGINE_load_private_key: eng_back.c:858: error:82067065:pkcs11 engine:ctx_load_privkey:object not found
[ ] Loading certificate from file: pkcs11:id=0477dda5f69dfb917a512ff03460557567690ab7
[!] error queue: ../ssl/ssl_rsa.c:615: error:140DC002:SSL routines:use_certificate_chain_file:system lib
[!] error queue: ../crypto/bio/bss_file.c:290: error:20074002:BIO routines:file_ctrl:system lib
[!] SSL_CTX_use_certificate_chain_file: ../crypto/bio/bss_file.c:288: error:02001002:system library:fopen:No such file or directory
[!] Service [https]: Failed to initialize TLS context
[ ] Deallocating section defaults</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (vanobl)]]></author>
			<pubDate>Wed, 03 Aug 2022 11:22:25 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/18027/#p18027</guid>
		</item>
	</channel>
</rss>
