AnthonyDeroche / mod_authnz_jwt

An authentication module for Apache httpd using JSON Web Tokens
Other
79 stars 46 forks source link

Error on libssl.so.1.1 with httpd:2.4.58 image #72

Closed sburky closed 5 months ago

sburky commented 5 months ago

I have an error when i use an image rebuilding with your dockerfile (thanks to that) with httpd:2.4.58 image.

root@apache-6657f4499c-nmz6h:/usr/local/apache2# httpd -t httpd: Syntax error on line 66 of /usr/local/apache2/conf/httpd.conf: Syntax error on line 21 of /usr/local/apache2/conf/modules.d/1.authentification.conf: Cannot load modules/mod_authnz_jwt.so into server: libssl.so.1.1: cannot open shared object file: No such file or directory root@apache-6657f4499c-nmz6h:/usr/local/apache2#

Is there any operation i miss ?

sburky commented 5 months ago

there are only module libssl.so.3 in the /usr/llib/x86_64-linux-gnu folder .... not the libssl.so.1.1....

In fact the httpd:2.4 has OpenSSL V3 installed and the libjwt is linked with OpenSSL 1.1.1 ...

image

sburky commented 5 months ago

The solution is to build image from debian:bookworm-slim (packaged with openSSL3) ....

` FROM debian:bookworm-slim as build

WORKDIR /build RUN apt-get update && \ apt-get install -y ca-certificates \ make automake \ git g++ libtool pkg-config \ autoconf libssl-dev check \ libjansson-dev libz-dev procps \ apache2 apache2-dev

ARG LIBJWT_VERSION=1.15.3 ARG MOD_AUTHNZ_JWT_VERSION=1.2.0

RUN git clone https://github.com/benmcollins/libjwt.git && \ cd libjwt && \ git checkout tags/v$LIBJWT_VERSION && \ autoreconf -i && \ ./configure && \ make && \ make install

RUN git clone https://github.com/AnthonyDeroche/mod_authnz_jwt.git && \ cd mod_authnz_jwt && \ git checkout tags/v$MOD_AUTHNZ_JWT_VERSION && \ autoreconf -ivf && \ PKG_CONFIG_PATH=/usr/local ./configure && \ make && \ make install

FROM httpd:2.4

ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

COPY --from=build /usr/local/lib/libjwt.* /usr/lib/x86_64-linux-gnu COPY --from=build /usr/lib/apache2/modules/mod_authnz_jwt.so /usr/local/apache2/modules/mod_authnz_jwt.so RUN rm /usr/lib/x86_64-linux-gnu/libjwt.so.2 && \ ln -s /usr/lib/x86_64-linux-gnu/libjwt.so.2.9.0 /lib/x86_64-linux-gnu/libjwt.so.2 && \ rm /usr/lib/x86_64-linux-gnu/libjwt.so && \ ln -s /usr/lib/x86_64-linux-gnu/libjwt.so.2.9.0 /lib/x86_64-linux-gnu/libjwt.so &&

RUN apt-get update -y \ && apt-get -y install apache2-utils libapache2-mod-auth-openidc \ && rm -rf /var/lib/apt/lists/* \ && cp /usr/lib/apache2/modules/mod_auth_openidc.so /usr/local/apache2/modules \ && ldconfig -n /usr/local/apache2/modules `

sburky commented 5 months ago

The solution is to build image from debian:bookworm-slim (packaged with openSSL3) ....