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
Member

.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 Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI 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
Member

@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
Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
@JRahnama JRahnama merged commit 0441595 into dotnet:main Sep 2, 2023
132 checks passed
@JRahnama JRahnama deleted the update-namemismatch-error branch September 8, 2023 12:53
@DavoudEshtehari DavoudEshtehari added this to In progress in SqlClient v5.2 via automation Sep 29, 2023
@DavoudEshtehari DavoudEshtehari moved this from In progress to Done in SqlClient v5.2 Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants