Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update | Update SSL certificate error messages #2060

Merged
merged 5 commits into from
Sep 2, 2023

Conversation

JRahnama
Copy link
Contributor

.Net 7 and greater versions has a new API X509Certificate2.MatchesHostname which could be used to determine if a provided hostname exists in certificate SANs or Subject, unfortunately that is not available in lower versions.
This PR updates the .Net 7 and greater versions with the new API and tries to provide more specific error on lower versions.

@JRahnama JRahnama added the Area\Managed SNI Issues that are targeted to the Managed SNI codebase. label Jun 14, 2023
@JRahnama JRahnama added this to the 5.2.0-preview3 milestone Jun 14, 2023
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch has no changes to coverable lines.

Files Changed Coverage
...core/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs 0.00%
...SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs 0.00%

📢 Thoughts on this report? Let us know!.

Copy link
Contributor

@David-Engel David-Engel left a comment

Choose a reason for hiding this comment

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

There is another ValidateSslServerCertificate function below the one being modified that needs similar changes to what you are making (the serverCertificate connection option validation).

Copy link
Contributor

@DavoudEshtehari DavoudEshtehari left a comment

Choose a reason for hiding this comment

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

I'd suggest collecting all the possible exceptions and throwing a single exception at the end.

@Kaur-Parminder Kaur-Parminder marked this pull request as draft July 6, 2023 22:15
@JRahnama JRahnama force-pushed the update-namemismatch-error branch from d99a854 to 8c411aa Compare August 21, 2023 21:25
Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
@JRahnama JRahnama merged commit 0441595 into dotnet:main Sep 2, 2023
@JRahnama JRahnama deleted the update-namemismatch-error branch September 8, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area\Managed SNI Issues that are targeted to the Managed SNI codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants