Skip to content

Fix hostname validation with OpenSSL/QuicTLS - #6274

Merged
Guillaume Hetier (guhetier) merged 3 commits into
mainfrom
guhetier/hostname_validation
Aug 28, 2026
Merged

Fix hostname validation with OpenSSL/QuicTLS#6274
Guillaume Hetier (guhetier) merged 3 commits into
mainfrom
guhetier/hostname_validation

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

Document the distinction between endpoint and IP-only formatting, increase QUIC_ADDR_STR to the platform maximum, and expand parsing and formatting coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 25e9a5bc-61c1-44b4-9221-b75067ecca54
@guhetier
Guillaume Hetier (guhetier) requested a review from a team as a code owner August 28, 2026 16:57
@guhetier Guillaume Hetier (guhetier) changed the title Guhetier/hostname validation Fix hostname validation with OpenSSL/QuicTLS Aug 28, 2026
Comment thread src/inc/msquic_posix.h
@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.46%. Comparing base (56d82b3) to head (df47a5c).
⚠️ Report is 34 commits behind head on main.

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             @@
##             main    #6274      +/-   ##
==========================================
+ Coverage   84.07%   85.46%   +1.38%     
==========================================
  Files          60       60              
  Lines       18974    18989      +15     
==========================================
+ Hits        15952    16228     +276     
+ Misses       3022     2761     -261     

☔ 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 508e811 into main Aug 28, 2026
608 of 609 checks passed
@guhetier
Guillaume Hetier (guhetier) deleted the guhetier/hostname_validation branch August 28, 2026 18:51
Guillaume Hetier (guhetier) added a commit that referenced this pull request Aug 28, 2026
## 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
Guillaume Hetier (guhetier) added a commit that referenced this pull request Aug 28, 2026
## 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
Guillaume Hetier (guhetier) added a commit that referenced this pull request Aug 28, 2026
## 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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25e9a5bc-61c1-44b4-9221-b75067ecca54
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