Skip to content

ext/openssl: fix OpenSSL 4 build and test compatibility - #22267

Merged
shivammathur merged 5 commits into
php:masterfrom
shivammathur:fix-openssl4-tests
Jul 3, 2026
Merged

ext/openssl: fix OpenSSL 4 build and test compatibility#22267
shivammathur merged 5 commits into
php:masterfrom
shivammathur:fix-openssl4-tests

Conversation

@shivammathur

@shivammathur shivammathur commented Jun 10, 2026

Copy link
Copy Markdown
Member

@shivammathur
shivammathur requested a review from iluuu1994 June 10, 2026 12:56
@shivammathur shivammathur changed the title Fix openssl4 tests ext/openssl: fix OpenSSL 4 build and test compatibility Jun 10, 2026

@iluuu1994 iluuu1994 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.

Thanks @shivammathur! I can't meaningfully review the OpenSSL part (though I did look at it and did not see an obvious mistake), but ack for the GHA part.

@TimWolla
TimWolla removed their request for review June 29, 2026 16:48

@bukka bukka 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.

I checked it all and it makes sense. There might be a bit safer version of that common name match but I won't object back porting as it is if you have properly tested even on 1.1.1

Comment thread ext/openssl/xp_ssl.c
Comment on lines +577 to +582
name = X509_get_subject_name(peer);
name_index = X509_NAME_get_index_by_NID(name, NID_commonName, -1);
if (name_index == -1) {
php_stream_warn(stream, NetworkRecvFailed, "Unable to locate peer certificate CN");
return false;
}

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 good for master but for backport, wouldn't be enough to just const X509_NAME *cert_name; and leave the rest?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed, I only wanted to target the master branch with this, but if we want to backport, I can do another PR keeping this limited to the const X509_NAME *cert_name change.

@shivammathur
shivammathur force-pushed the fix-openssl4-tests branch 2 times, most recently from 4f01ab7 to 97088f2 Compare July 1, 2026 23:59
@shivammathur

Copy link
Copy Markdown
Member Author

@bukka I have made a minor fix to keep OpenSSL 1.1.1 compatibility and tested it.

@shivammathur
shivammathur merged commit 6aca6e3 into php:master Jul 3, 2026
18 checks passed
@shivammathur
shivammathur deleted the fix-openssl4-tests branch July 4, 2026 04:46
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