Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Ensure the SSL module is enabled (#186)
Browse files Browse the repository at this point in the history
Previously the compile silently skipped the SSL module:

```
Configuration summary
  ...
  + OpenSSL library is not used
```

Which causes failures if SSL related directives are used.

Now the `--with-http_ssl_module` flag is passed, which results in:

```
Configuration summary
  ...
  + using system OpenSSL library
```

And `nginx -V` now includes an additional line:

```
built with OpenSSL 1.1.1f  31 Mar 2020
```

See:
https://github.com/matsumotory/ngx_mruby/tree/master/docs/install#3-a-using-buildsh

Fixes #185.
Closes W-8449334.
  • Loading branch information
edmorley authored Nov 19, 2020
1 parent a4f1bc4 commit 8a4baf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* [#186](https://github.com/heroku/heroku-buildpack-static/pull/186) Ensure the SSL module is enabled

## v5 (2020-11-11)

Expand Down
14 changes: 12 additions & 2 deletions scripts/build_ngx_mruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ cd "${BUILD_DIR}"
echo "Downloading ngx_mruby from ${NGX_MRUBY_URL}"
curl -sSfL "${NGX_MRUBY_URL}" | tar -xz --strip-components 1

./build.sh
# Taken from the defaults:
# https://github.com/matsumotory/ngx_mruby/blob/v2.2.3/build.sh#L23-L40
BUILD_OPTS="--prefix=${PWD}/build/nginx"
BUILD_OPTS+=' --with-http_stub_status_module --with-stream --without-stream_access_module --with-cc-opt=-fno-common'
# Our custom addition, to enable the SSL module.
BUILD_OPTS+=' --with-http_ssl_module'

NGINX_CONFIG_OPT_ENV="${BUILD_OPTS}" ./build.sh
make install

echo 'nginx build complete!'
Expand All @@ -26,7 +33,10 @@ NGINX_BIN_DIR="${BUILD_DIR}/build/nginx/sbin"
cd "${NGINX_BIN_DIR}"

# Check that nginx can start
./nginx -v
./nginx -V

# Check that OpenSSL support was enabled
./nginx -V |& grep 'built with OpenSSL' || { echo 'Missing OpenSSL support!'; exit 1; }

NGINX_VERSION=$(./nginx -v |& cut -d '/' -f 2-)
ARCHIVE_PATH="${OUTPUT_DIR}/nginx-${NGINX_VERSION}-ngx_mruby-${NGX_MRUBY_VERSION}.tgz"
Expand Down

0 comments on commit 8a4baf2

Please sign in to comment.