Skip to content

Commit 06e5427

Browse files
committed
nginx-ssl-ja3: config validates OpenSSL version
1 parent d2b182f commit 06e5427

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ stream {
5656

5757
### Dependencies
5858

59-
* [OpenSSL](https://github.com/openssl) - master dev version
59+
* [OpenSSL](https://github.com/openssl) - 1.1.1 (dev master version)
6060

6161
The master version OpenSSL is required because this module fetches the
6262
extensions types declared at SSL/TLS Client Hello by using the new early
63-
callback [SSL_CTX_set_early_c](https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_early_cb.html).
63+
callback [SSL_CTX_set_early_cb](https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_early_cb.html).
6464

6565
I was unable to find a way to get these values with the current versions of
6666
nginx and OpenSSL.

config

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ ngx_module_incs=$ngx_addon_dir/src
33

44
NGINX_VERSION=`grep version src/core/nginx.h | sed 's/#define nginx_version *//;'`
55

6-
#TODO: To validate if correct OpenSSL version is available
76

87
if [ ! -z "${NGINX_VERSION}" ]
98
then
@@ -26,3 +25,22 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
2625
"
2726

2827
CORE_LIBS="$CORE_LIBS"
28+
29+
#
30+
# OpenSSL 1.1.1 with SSL_CTX_set_early_cb
31+
#
32+
ngx_feature="SSL_CTX_set_early_cb()"
33+
ngx_feature_name="NGX_HAVE_OPENSSL_SSL_EARLY_CB"
34+
ngx_feature_run=no
35+
ngx_feature_incs="#include <openssl/ssl.h>"
36+
ngx_feature_path=
37+
ngx_feature_libs="-lssl $NGX_LD_OPT"
38+
ngx_feature_test="SSL_CTX_set_early_cb(0, 0, 0);"
39+
. auto/feature
40+
41+
if [ $ngx_found = no ]; then
42+
echo " ! incorrect OpenSSL version. use >= 1.1.1"
43+
exit 1
44+
fi
45+
46+

0 commit comments

Comments
 (0)