Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply kn007 ocsp stapling patch #116

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ RUN \
gd-dev \
geoip-dev \
perl-dev \
patch \
&& apk add --no-cache --virtual .brotli-build-deps \
autoconf \
libtool \
Expand Down Expand Up @@ -156,6 +157,14 @@ RUN \
echo "Downloading ngx_http_geoip2_module ..." \
&& git clone --depth 1 --branch ${GEOIP2_VERSION} https://github.com/leev/ngx_http_geoip2_module /usr/src/ngx_http_geoip2_module

RUN \
echo "Downloading Enable_BoringSSL_OCSP patch ..." \
&& set -eux \
&& cd /usr/src \
&& wget -q https://raw.githubusercontent.com/kn007/patch/cd03b77647c9bf7179acac0125151a0fbb4ac7c8/Enable_BoringSSL_OCSP.patch \
&& cd /usr/src/nginx-$NGINX_VERSION \
&& patch -p01 < /usr/src/Enable_BoringSSL_OCSP.patch

RUN \
echo "Cloning and configuring njs ..." \
&& cd /usr/src \
Expand Down
3 changes: 2 additions & 1 deletion tests/https.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ server {
# https://letsencrypt.org/docs/certificates-for-localhost/
ssl_certificate /etc/nginx/ssl/localhost.crt;
ssl_certificate_key /etc/nginx/ssl/localhost.key;

ssl_stapling_file /path/to/ocsp.resp;

# TLSv1.3 is required for QUIC.
ssl_protocols TLSv1.2 TLSv1.3;

Expand Down
17 changes: 17 additions & 0 deletions tests/oscp.cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

#https://kn007.net/topics/let-nginx-support-ocsp-stapling-when-using-boringssl/
openssl ocsp -no_nonce \
-CAfile /path/to/root.crt \
-VAfile /path/to/root.crt \
-issuer /path/to/issuer.crt \
-cert /path/to/server.crt \
-respout /path/to/ocsp.resp \
-url "$(openssl x509 -in /path/to/bundle.crt -text | grep "OCSP - URI:" | cut -d: -f2,3)" \
> /tmp/ocsp.reply 2>&1

at $(date -d "$(cat /tmp/ocsp.reply | grep 'Next Update: ' | awk -F': ' '{print $2}') + 1 minutes" +"%H:%M %Y-%m-%d") < ~/ocsp.cron.sh

service nginx reload

exit
Loading