Created
October 15, 2018 11:19
-
-
Save shadz3rg/7badec13e154751116a6446fe9f61906 to your computer and use it in GitHub Desktop.
Настройка ГОСТ OpenSSL под Ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Спасибо большое!
GOST-engine можно не компилировать, достаточно поставить пакет:
apt install libengine-gost-openssl1.1
Никто не знает, можно как-то красивенько замутить? Типа настройки ГОСТ вынести в отдельный конфиг, а потом просто заинклудить. Вот типа этого:
# Note that you can include other files from the main configuration
# file using the .include directive.
#.include filename
У меня не получпется. Хочу просто сделать красиво.
чтоб было красиво, можно просто использовать libressl, где не нужно редактировать конфиг
Спасибо! На CentOS7 тоже заработало, с использованием cmake3
Спасибо! Теперь ты мой друг)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Спасибо!
Сработало и на ubuntu 16.04 (компилил OpenSSL 1.1.1b перед этим отдельно )