icing / mod_md

Let's Encrypt (ACME) in Apache httpd
https://icing.github.io/mod_md/
Apache License 2.0
334 stars 28 forks source link

Compile problem on Fedora 37 and AlmaLinux 9.1 (rhel 9.1) #309

Closed pizzi80 closed 1 year ago

pizzi80 commented 1 year ago

Fedora 37

configure: summary of build options:

    Version:        2.4.21 shared 11:0:6
    Host type:      x86_64-pc-linux-gnu
    Install prefix: /etc/httpd
    APXS:           /usr/bin/apxs
    HTTPD-VERSION:  2.4.56
    C compiler:     gcc => gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
    CFLAGS:          -g -O2 -DMD_HAVE_ARC4RANDOM
    WARNCFLAGS:      -Wall -Wconversion -Wextra -Werror -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith -Wformat-security -Wwrite-strings -Wshadow -Winline -Wnested-externs -Wfloat-equal -Wundef -Wendif-labels -Wempty-body -Wvla -Wunreachable-code -Waddress -Wattributes -Wdiv-by-zero -std=c89 -Wdeclaration-after-statement -Wnull-dereference -Wdouble-promotion -Wshadow -Wformat=2 -Wno-null-pointer-subtraction
    LDFLAGS:        -lcurl -L/usr/lib64  -L/usr/lib64
    LIBS:           -lcurl -ljansson -lcrypto 
    CPPFLAGS:       -I/usr/include/httpd -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE  -I/usr/include/httpd -I/usr/include/apr-1
    curl            curl
    curl-config     curl-config
    jansson         -
    openssl         openssl
    test-server     none (none)

AlmaLinux 9.1

configure: summary of build options:

    Version:        2.4.21 shared 11:0:6
    Host type:      x86_64-pc-linux-gnu
    Install prefix: /etc/httpd
    APXS:           /usr/bin/apxs
    HTTPD-VERSION:  2.4.53
    C compiler:     gcc => gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
    CFLAGS:          -g -O2 
    WARNCFLAGS:      -Wall -Wconversion -Wextra -Werror -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith -Wformat-security -Wwrite-strings -Wshadow -Winline -Wnested-externs -Wfloat-equal -Wundef -Wendif-labels -Wempty-body -Wvla -Wunreachable-code -Waddress -Wattributes -Wdiv-by-zero -std=c89 -Wdeclaration-after-statement -Wnull-dereference -Wdouble-promotion -Wshadow -Wformat=2 -Wno-null-pointer-subtraction
    LDFLAGS:        -lcurl -L/usr/lib64  -L/usr/lib64
    LIBS:           -lcurl -ljansson -lcrypto 
    CPPFLAGS:       -I/usr/include/httpd -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE  -I/usr/include/httpd -I/usr/include/apr-1
    curl            curl
    curl-config     curl-config
    jansson         -
    openssl         openssl
    test-server     none (none)
[xyz@localhost mod_md-2.4.21]$ make
Making all in src

  CC       mod_md_la-mod_md_config.lo
  CC       mod_md_la-mod_md_drive.lo
  CC       mod_md_la-mod_md_ocsp.lo
  CC       mod_md_la-mod_md_os.lo
  CC       mod_md_la-mod_md_status.lo
  CC       mod_md_la-mod_md.lo
  CC       libmd_la-md_acme.lo
  CC       libmd_la-md_acme_acct.lo
  CC       libmd_la-md_acme_authz.lo
  CC       libmd_la-md_acme_drive.lo
  CC       libmd_la-md_acme_order.lo
  CC       libmd_la-md_acmev2_drive.lo
  CC       libmd_la-md_core.lo
  CC       libmd_la-md_curl.lo
  CC       libmd_la-md_crypt.lo
md_crypt.c: In function ‘md_pkey_get_rsa_e64’:
md_crypt.c:992:5: error: ‘EVP_PKEY_get1_RSA’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  992 |     RSA *rsa = EVP_PKEY_get1_RSA(pkey->pkey);
      |     ^~~
In file included from md_crypt.c:29:
/usr/include/openssl/evp.h:1348:16: note: declared here
 1348 | struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
      |                ^~~~~~~~~~~~~~~~~
md_crypt.c:997:5: error: ‘RSA_get0_key’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  997 |     RSA_get0_key(rsa, NULL, &e, NULL);
      |     ^~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:36,
                 from /usr/include/openssl/pem.h:23,
                 from md_crypt.c:31:
/usr/include/openssl/rsa.h:217:28: note: declared here
  217 | OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
      |                            ^~~~~~~~~~~~
md_crypt.c: In function ‘md_pkey_get_rsa_n64’:
md_crypt.c:1004:5: error: ‘EVP_PKEY_get1_RSA’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 1004 |     RSA *rsa = EVP_PKEY_get1_RSA(pkey->pkey);
      |     ^~~
/usr/include/openssl/evp.h:1348:16: note: declared here
 1348 | struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
      |                ^~~~~~~~~~~~~~~~~
md_crypt.c:1009:5: error: ‘RSA_get0_key’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 1009 |     RSA_get0_key(rsa, &n, NULL, NULL);
      |     ^~~~~~~~~~~~
/usr/include/openssl/rsa.h:217:28: note: declared here
  217 | OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
      |                            ^~~~~~~~~~~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-null-pointer-subtraction’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:805: libmd_la-md_crypt.lo] Errore 1

make: *** [Makefile:538: all-recursive] Errore 1

any advice?

pizzi80 commented 1 year ago

using ./configure --with-apxs=/usr/bin/apxs without --enable-werror it works

icing commented 1 year ago

Thanks, I think @ylavic made changes for this in apache trunk, need to bring those over here.

icing commented 1 year ago

@pizzi80 could you give the current master a test on your setup? Thanks.

pizzi80 commented 1 year ago

Ok!

I followed the instructions inside https://github.com/icing/mod_md/blob/master/docs/Testing.md

wget the master.zip from github and then

autoreconf -i
./configure
make 
make install

It works both on Fedora 37 and AlmaLinux 9.1 :+1: :+1:

thanks for your fast reply and implementations! :rocket:

I read all the docs (ssl certs and stapling) and this module it's fantastic :1st_place_medal:

I'll probably test this module on a real domain soon :crossed_fingers: