BoringSSL als OpenSSL Ersatz mit NGINX [from Source]

Heute werden wir BoringSSL als OpenSSL ersatz für NGINX aus dem Source code kompilieren.

Infos und Warnhinweise zur Benutzung von BoringSSL findest du hier

 

1. – Installation der benötigten Programme

apt install build-essential cmake golang libpcre3-dev zlib1g-dev libcurl4-openssl-dev git

2. – BoringSSL kompilieren

BoringSSL herunterladen

git clone https://boringssl.googlesource.com/boringssl

In das heruntergeladene Verzeichnis gehen

cd boringssl

Build Verzeichnis erstellen

mkdir build
cd build

Jetzt kompilieren wir BoringSSL

cmake ..
make

3. – BoringSSL mit NGINX kompatibel machen

Zum Stammverzeichnis gehen

cd ..

.openssl Verzeichnis für NGINX erstellen und einen symlink zu BoringSSL erstellen

mkdir -p .openssl/lib
cd .openssl
ln -s ../include include

BoringSSL libraries kopieren

cd ..
cp "build/crypto/libcrypto.a" ".openssl/lib"
cp "build/ssl/libssl.a" ".openssl/lib"

4. – NGINX herunterladen und kompilieren

cd ..

NGINX herunterladen

wget http://nginx.org/download/nginx-1.15.2.tar.gz

NGINX auspacken

tar xzf nginx-1.15.2.tar.gz

NGINX konfigurieren

cd nginx-1.15.2
./configure \
--prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--user=www-data \
--group=www-data \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_v2_module \
--with-http_sub_module \
--with-openssl="../boringssl" \
--with-cc-opt="-g -O2 -fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -I ../boringssl/.openssl/include/" \
--with-ld-opt="-Wl,-Bsymbolic-functions -Wl,-z,relro -L ../boringssl/.openssl/lib/"

Zum kopieren bitte diese Text Dokument nutzen

Build Fehler „Error 127“ beheben (vor dem kompilieren 😉 )

touch "../boringssl/.openssl/include/openssl/ssl.h"

Und jetzt wird NGINX kompiliert

make
make install

5. – NGINX neustarten

service nginx restart

 

Und jetzt sind wir schon am ende angekommen. Ich hoffe dieses Tutorial war hilfreich 😀

Das könnte Sie auch interessieren …

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert