Building OpenResty with OpenSSL 1.0

Does your distro include OpenSSL 1.1 by default?

OpenResty is the platform I use to build all of my web applications. At the moment, OpenResty only builds with OpenSSL 1.0, but my distribution (Arch Linux), and maybe yours, has moved to OpenSSL 1.1. With a plain ./configure this means that OpenResty will not build.

Here’s how to build it on Arch. It should be easy to adapt to other distributions.

Install the OpenSSL 1.0 from the package manager:

pacman -Sy openssl-1.0

Now when building OpenResty you can configure it like this:

./configure --with-cc-opt="-I/usr/include/openssl-1.0" --with-ld-opt="-L/usr/lib/openssl-1.0

Don’t forget to add your other standard configuration options as well

No OpenSSL 1.0 package available

If you don’t have an OpenSSL 1.0 package available in your package manager then you can use the --with-openssl=DIR option on the configure script to point to a copy of the source code you can download. OpenSSL will build alongside OpenResty.

You can find older versions of OpenSSL on their website. You can run something like the following in the OpenResty build directory:

curl -O
tar xzf openssl-1.0.1u.tar.gz
./configure --with-openssl=openssl-1.0.1u