Skip to content

ext/openssl: Fix build with OpenSSL 4.1 - #24686

Merged
LamentXU123 merged 3 commits into
php:PHP-8.6from
LamentXU123:openssl-4.1-compat-php86
Oct 26, 2026
Merged

LamentXU123 merged 3 commits into
php:PHP-8.6from
LamentXU123:openssl-4.1-compat-php86

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

OpenSSL 4.1 deprecates ASN1_STRING_set() and ASN1_STRING_length(). use ASN1_STRING_set1_data() and ASN1_STRING_get_length() instead as recommended in official doc
https://docs.openssl.org/4.1/man7/ossl-guide-migration/#asn1_string-values-have-never-been-nul-byte-terminated

@shivammathur shivammathur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix these and check CI

Comment thread ext/openssl/openssl.c
Comment thread ext/openssl/openssl_backend_common.c
Co-Authored-By: Shivam Mathur <contact@shivammathur.com>
@LamentXU123

Copy link
Copy Markdown
Member Author

Also add a regressional test for these reviews.

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is right, thanks!
One question though: Why did you need to add the 'session_id_context' options in the tests?

@LamentXU123

Copy link
Copy Markdown
Member Author

OpenSSL 4.1 skip session ticket when server peer verification is enabled but no session ID context is set cuz those tickets would be rejected on reuse. I can only use session_id_context to ensure every ticket a valid content...

@ndossche

Copy link
Copy Markdown
Member

Okay

@LamentXU123
LamentXU123 merged commit 3678f39 into php:PHP-8.6 Oct 26, 2026
18 checks passed
ndossche added a commit that referenced this pull request Oct 26, 2026
* PHP-8.6:
  Fix GH-24438: Preserve indirect types in JIT side traces
  Fix GH-17733: System entropy does not take into account function order, resulting in wrong functions possibly called in different configurations
  ext/openssl: Fix build with OpenSSL 4.1 (#24686)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants