Skip to content

Instantly share code, notes, and snippets.

@shadz3rg
Created October 15, 2018 11:19
  • Star 34 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shadz3rg/7badec13e154751116a6446fe9f61906 to your computer and use it in GitHub Desktop.
Настройка ГОСТ OpenSSL под Ubuntu 18.04
# Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-36-generic x86_64)
# (из коробки) OpenSSL 1.1.0g 2 Nov 2017
# (из коробки) curl 7.58.0 (x86_64-pc-linux-gnu)
# PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
# Компилим GOST-engine
sudo apt install cmake libssl-dev
git clone --branch=openssl_1_1_0 https://github.com/gost-engine/engine.git gost-engine/engine
cd gost-engine/engine
cmake .
make
# узнаем нужную директорию, копируем туда
openssl version -e
cp bin/gost.so /usr/lib/x86_64-linux-gnu/engines-1.1
# конфиг
cp /etc/ssl/openssl.cnf /etc/ssl/openssl_custom.cnf
nano /etc/ssl/openssl_custom.cnf
# в начало файла
openssl_conf = openssl_def
# в конец
[openssl_def]
engines = engine_section
[engine_section]
gost = gost_section
[gost_section]
engine_id = gost
dynamic_path = /usr/lib/x86_64-linux-gnu/engines-1.1/gost.so
default_algorithms = ALL
CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet
# включаем новый конфиг
export OPENSSL_CONF=/etc/ssl/openssl_custom.cnf
openssl s_client -connect service.rosminzdrav.ru:443
curl https://service.rosminzdrav.ru
@stahko
Copy link

stahko commented Apr 17, 2019

Спасибо!
Сработало и на ubuntu 16.04 (компилил OpenSSL 1.1.1b перед этим отдельно )

@arimanov
Copy link

Спасибо большое!

@4815162342lost
Copy link

GOST-engine можно не компилировать, достаточно поставить пакет:
apt install libengine-gost-openssl1.1

@4815162342lost
Copy link

Никто не знает, можно как-то красивенько замутить? Типа настройки ГОСТ вынести в отдельный конфиг, а потом просто заинклудить. Вот типа этого:

# Note that you can include other files from the main configuration
# file using the .include directive.
#.include filename

У меня не получпется. Хочу просто сделать красиво.

@mikhailnov
Copy link

чтоб было красиво, можно просто использовать libressl, где не нужно редактировать конфиг

@p-arse
Copy link

p-arse commented Mar 19, 2020

Спасибо! На CentOS7 тоже заработало, с использованием cmake3

@Code8525
Copy link

Спасибо! Теперь ты мой друг)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment