@@ -25,6 +25,38 @@ RUN <<'END' bash -e
2525 cp lib/libzstd.so* /opt/lib
2626END
2727
28+
29+ # Install OpenSSL 1.1 because Relay doesn't work with OpenSSL 3
30+ # https://github.com/openssl/openssl/releases
31+ ENV VERSION_OPENSSL=1.1.1t
32+ ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl
33+ ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem"
34+ ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem"
35+ RUN rm -rf ${OPENSSL_BUILD_DIR}
36+ RUN set -xe; \
37+ mkdir -p ${OPENSSL_BUILD_DIR}; \
38+ curl -Ls https://github.com/openssl/openssl/archive/OpenSSL_${VERSION_OPENSSL//./_}.tar.gz \
39+ | tar xzC ${OPENSSL_BUILD_DIR} --strip-components=1
40+ WORKDIR ${OPENSSL_BUILD_DIR}/
41+ RUN CFLAGS="" \
42+ CPPFLAGS="-I${INSTALL_DIR}/include -I/usr/include" \
43+ LDFLAGS="-L${INSTALL_DIR}/lib64 -L${INSTALL_DIR}/lib" \
44+ ./config \
45+ --prefix=${INSTALL_DIR} \
46+ --openssldir=${INSTALL_DIR}/bref/ssl \
47+ --release \
48+ no-tests \
49+ shared \
50+ zlib
51+ # Explicitly compile make without parallelism because it fails if we use -jX (no error message)
52+ # I'm not 100% sure why, and I already lost 4 hours on this, but I found this:
53+ # https://github.com/openssl/openssl/issues/9931
54+ # https://stackoverflow.com/questions/28639207/why-cant-i-compile-openssl-with-multiple-threads-make-j3
55+ # Run `make install_sw install_ssldirs` instead of `make install` to skip installing man pages https://github.com/openssl/openssl/issues/8170
56+ RUN make -j1 install_sw install_ssldirs
57+ RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOURCE}
58+
59+
2860RUN <<'END' bash -e
2961 export php_version=$(php-config --version | cut -c -3)
3062 mkdir -p /tmp/relay
0 commit comments