Undefined reference to CRYPTO_free_ex_index

Hey there,

After updating to 2.1.0, wget2 no longer builds against libressl, after configuring it with --with-ssl=openssl, as it throws the following error:

  CC       libwget_la-ssl_openssl.lo
ssl_openssl.c: In function 'tls_exit':
ssl_openssl.c:132:17: warning: implicit declaration of function 'CRYPTO_free_ex_index'; did you mean 'CRYPTO_free_ex_data'? [-Wimplicit-function-declaration]
  132 |                 CRYPTO_free_ex_index(CRYPTO_EX_INDEX_APP, ssl_userdata_idx);
      |                 ^~~~~~~~~~~~~~~~~~~~
      |                 CRYPTO_free_ex_data
ssl_openssl.c: In function '_ocsp_stapled_response_compare_func':
ssl_openssl.c:580:28: warning: passing argument 1 of 'OCSP_id_cmp' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  580 |         return OCSP_id_cmp(certid, stored->certid);
      |                            ^~~~~~
In file included from ssl_openssl.c:31:
cross/usr/include/openssl/ocsp.h:253:34: note: expected 'OCSP_CERTID *' {aka 'struct ocsp_cert_id_st *'} but argument is of type 'const OCSP_CERTID *' {aka
 'const struct ocsp_cert_id_st *'}
  253 | int     OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
      |                     ~~~~~~~~~~~~~^
ssl_openssl.c: In function 'ocsp_stapled_responses_add_single':
ssl_openssl.c:610:47: warning: passing argument 1 of 'OCSP_CERTID_dup' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  610 |         OCSP_CERTID *certid = OCSP_CERTID_dup(OCSP_SINGLERESP_get0_id(singleresp));
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cross/usr/include/openssl/ocsp.h:190:43: note: expected 'OCSP_CERTID *' {aka 'struct ocsp_cert_id_st *'} but argument is of type 'const OCSP_CERTID *' {aka
 'const struct ocsp_cert_id_st *'}
  190 | OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
      |                              ~~~~~~~~~~~~~^~
renamed 'libwget_la-ssl_openssl.loT' -> 'libwget_la-ssl_openssl.lo'

...

make[2]: Leaving directory 'cross/src/wget2/libwget'
make[2]: Entering directory 'cross/src/wget2/libwget'
  CCLD     libwget.la
css_tokenizer.c:297:7: warning: type of 'yyrealloc' does not match original declaration [-Wlto-type-mismatch]
  297 | void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
      |       ^
css.c:67:7: note: type mismatch in parameter 3
   67 | void *yyrealloc(void *p, size_t size) {
      |       ^
css.c:67:7: note: type 'void' should match type 'void *'
css.c:67:7: note: 'yyrealloc' was previously declared here
css_tokenizer.c:296:7: warning: type of 'yyalloc' does not match original declaration [-Wlto-type-mismatch]
  296 | void *yyalloc ( yy_size_t , yyscan_t yyscanner );
      |       ^
css.c:64:7: note: type mismatch in parameter 2
   64 | void *yyalloc(size_t size) {
      |       ^
css.c:64:7: note: type 'void' should match type 'void *'
css.c:64:7: note: 'yyalloc' was previously declared here

...

  CCLD     http_get2
toolchain/usr/lib/gcc/x86_64-glaucus-linux-musl/13.2.0/../../../../x86_64-glaucus-linux-musl/bin/ld: ../libwget/.libs/libwget.so: undefined reference to `C
RYPTO_free_ex_index'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2211: http_get2] Error 1
make[2]: Leaving directory 'cross/src/wget2/examples'
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory 'cross/src/wget2/examples'
  CCLD     batch_loader
toolchain/usr/lib/gcc/x86_64-glaucus-linux-musl/13.2.0/../../../../x86_64-glaucus-linux-musl/bin/ld: ../libwget/.libs/libwget.so: undefined reference to `C
RYPTO_free_ex_index'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2195: batch_loader] Error 1
make[2]: Leaving directory 'cross/src/wget2/examples'
make[2]: Entering directory 'cross/src/wget2/examples'
  CCLD     http_multi_get
toolchain/usr/lib/gcc/x86_64-glaucus-linux-musl/13.2.0/../../../../x86_64-glaucus-linux-musl/bin/ld: ../libwget/.libs/libwget.so: undefined reference to `C
RYPTO_free_ex_index'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2215: http_multi_get] Error 1
make[2]: Leaving directory 'cross/src/wget2/examples'
make[2]: Entering directory 'cross/src/wget2/examples'
  CCLD     getstream
/usr/bin/install: creating directory '.libs'
toolchain/usr/lib/gcc/x86_64-glaucus-linux-musl/13.2.0/../../../../x86_64-glaucus-linux-musl/bin/ld: ../libwget/.libs/libwget.so: undefined reference to `C
RYPTO_free_ex_index'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2203: getstream] Error 1
make[2]: Leaving directory 'cross/src/wget2/examples'
make[1]: *** [Makefile:2129: all-recursive] Error 1
make: *** [Makefile:2037: all] Error 2

What could be the issue?

Edited by Ghost User