Skip to content

[CP] Fix hostname validation with OpenSSL/QuicTLS (#6274) - #6275

Merged
Guillaume Hetier (guhetier) merged 1 commit into
release/2.6from
guhetier/cp_hostname_validation_2_6_copilot
Aug 28, 2026
Merged

[CP] Fix hostname validation with OpenSSL/QuicTLS (#6274)#6275
Guillaume Hetier (guhetier) merged 1 commit into
release/2.6from
guhetier/cp_hostname_validation_2_6_copilot

Conversation

@guhetier

Copy link
Copy Markdown
Collaborator

Description

Addresses https://microsoft.visualstudio.com/OS/_workitems/edit/62840655

When using the OpenSSL or QuicTLS backends, the target hostname was not properly validated against the server certificate.
X509_VERIFY_PARAM_set1_host and X509_VERIFY_PARAM_set1_ip_asc are now properly called.

The server name provided to ConnectionStart is used for the validation, if it isn't provided, the target IP address is used instead.

Testing

CI. Manual testing validating a connection succeeds and fail as expected against various certificate matching or not the hostname and/or IP.
New automated test cases will be added in a follow up.

Documentation

N/A

## Description

Addresses https://microsoft.visualstudio.com/OS/_workitems/edit/62840655

When using the OpenSSL or QuicTLS backends, the target hostname was not
properly validated against the server certificate.
`X509_VERIFY_PARAM_set1_host` and `X509_VERIFY_PARAM_set1_ip_asc` are
now properly called.

The server name provided to `ConnectionStart` is used for the
validation, if it isn't provided, the target IP address is used instead.

## Testing

CI. Manual testing validating a connection succeeds and fail as expected
against various certificate matching or not the hostname and/or IP.
New automated test cases will be added in a follow up.

## Documentation

N/A

---------

Copilot-Session: 25e9a5bc-61c1-44b4-9221-b75067ecca54
@guhetier
Guillaume Hetier (guhetier) marked this pull request as ready for review August 28, 2026 20:08
@guhetier
Guillaume Hetier (guhetier) requested a review from a team as a code owner August 28, 2026 20:08

@anrossi Anthony Rossi (anrossi) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I reviewed the core, inc, and platform changes, excluding test code. Looks good to me

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.39%. Comparing base (bd96bed) to head (8f3fed2).

Files with missing lines Patch % Lines
src/core/connection.c 50.00% 6 Missing ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.6    #6275      +/-   ##
===============================================
+ Coverage        85.25%   85.39%   +0.14%     
===============================================
  Files               60       60              
  Lines            18972    18984      +12     
===============================================
+ Hits             16175    16212      +37     
+ Misses            2797     2772      -25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier
Guillaume Hetier (guhetier) merged commit a01333c into release/2.6 Aug 28, 2026
491 of 492 checks passed
@guhetier
Guillaume Hetier (guhetier) deleted the guhetier/cp_hostname_validation_2_6_copilot branch August 28, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants