#1137476 asterisk: FTBFS with openssl 4.0

Package:
asterisk
Source:
asterisk
Description:
Open Source Private Branch Exchange (PBX)
Submitter:
Sebastian Andrzej Siewior
Date:
2026-06-24 14:55:02 UTC
Severity:
normal
Tags:
#1137476#5
Date:
2026-05-24 08:28:55 UTC
From:
To:
OpenSSL 4.0 is in experimental. This package fails to build against it:
| ../src/pj/ssl_sock_ossl.c: In function ‘init_ossl_ctx’:
| ../src/pj/ssl_sock_ossl.c:1599:29: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|  1599 |                     if ((xn = X509_get_subject_name(x)) == NULL)
|       |                             ^
| ../src/pj/ssl_sock_ossl.c: In function ‘parse_ossl_asn1_time’:
| ../src/pj/ssl_sock_ossl.c:2034:13: error: invalid use of incomplete typedef ‘ASN1_TIME’ {aka ‘const struct asn1_string_st’}
|  2034 |     utc = tm->type == V_ASN1_UTCTIME;
|       |             ^~
| ../src/pj/ssl_sock_ossl.c:2035:18: error: invalid use of incomplete typedef ‘ASN1_TIME’ {aka ‘const struct asn1_string_st’}
|  2035 |     p = (char*)tm->data;
|       |                  ^~
| ../src/pj/ssl_sock_ossl.c:2036:13: error: invalid use of incomplete typedef ‘ASN1_TIME’ {aka ‘const struct asn1_string_st’}
|  2036 |     len = tm->length;
|       |             ^~
| make[6]: *** [/build/reproducible-path/asterisk-22.9.0+dfsg+~cs6.16.60671434/third-party/pjproject/source/build/rules.mak:163: output/pjlib-x86_64-pc-linux-gnu/ssl_sock_ossl.o] Error 1

Full buildlog
https://breakpoint.cc/openssl-rebuild/logs-4/attempted/asterisk_22.9.0+dfsg+~cs6.16.60671434-1_amd64-2026-04-19T11:47:22Z

Sebastian

#1137476#12
Date:
2026-05-24 08:38:52 UTC
From:
To:
Owch. Could we please do without the mojibake?
#1137476#17
Date:
2026-05-24 10:34:23 UTC
From:
To:
My original build log had this. Not sure why though.
#1137476#22
Date:
2026-06-19 11:04:49 UTC
From:
To:
Dear Maintainer,

Please find attached a patch that fixes this issue.

#1137476#31
Date:
2026-06-24 14:53:34 UTC
From:
To:
Dear Maintainer,

I updated the patch, addressing upstream's comments.