-
Notifications
You must be signed in to change notification settings - Fork 702
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
Disable TLS certificate validation when disableTLSCertificateValidation
is set in the config file for a source.
#5514
Conversation
src/NuGet.Core/NuGet.Protocol/HttpSource/HttpHandlerResourceV3Provider.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpHandlerResourceV3ProviderTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, we need to improve the test coverage for this change. For example, we should ensure that the restore succeeds when disableTLSCertificateValidate
is set to true, and the mock server implementation includes a self-signed certificate in the chain. I am not an expert on what constitutes good test coverage for this change. Perhaps I am overcomplicating the issue regarding test coverage.
src/NuGet.Core/NuGet.Protocol/HttpSource/HttpHandlerResourceV3Provider.cs
Outdated
Show resolved
Hide resolved
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
src/NuGet.Core/NuGet.Protocol/HttpSource/HttpHandlerResourceV3Provider.cs
Show resolved
Hide resolved
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
test/TestUtilities/Test.Utility/TestServer/TcpListenerServer.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/TestServer/TcpListenerServer.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpHandlerResourceV3ProviderTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpHandlerResourceV3ProviderTests.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/TestServer/TcpListenerServer.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpHandlerResourceV3ProviderTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Protocol.Tests/HttpHandlerResourceV3ProviderTests.cs
Outdated
Show resolved
Hide resolved
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
Team Triage: Please consider adding some dotnet integration tests https://github.com/NuGet/NuGet.Client/blob/dev/test/TestUtilities/Test.Utility/FileSystemBackedV3MockServer.cs |
@kartheekp-ms @zivkan , I added some integration tests that are focused on dotnet restore. |
test/TestUtilities/Test.Utility/TestServer/TcpListenerServer.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetRestoreTests.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.Protocol/HttpSource/HttpHandlerResourceV3Provider.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/SelfSignedCertificateMockServer.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/SelfSignedCertificateMockServer.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/SelfSignedCertificateMockServer.cs
Outdated
Show resolved
Hide resolved
test/TestUtilities/Test.Utility/TestServer/TcpListenerServer.cs
Outdated
Show resolved
Hide resolved
public TcpListenerServer() | ||
{ } | ||
|
||
private static X509Certificate2 GenerateSelfSignedCertificate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GenerateSelfSignedCertificate
method has same logic in this class and also SelfSignedCertificateMockServer
. If possible, please consider removing the code duplication in a follow-up PR.
2baabcf
into
dev-feature-disable-TLS-certificate-verification
Bug
Fixes: NuGet/Home#13023
Regression? Last working version:
Description
Disable TLS certificate validation for the HTTP client handler when
disableTLSCertificateValidation
is set in the config file.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation