-
Notifications
You must be signed in to change notification settings - Fork 77
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
SLVS-1369 Add checkServerTrusted rpc method implementation #5667
SLVS-1369 Add checkServerTrusted rpc method implementation #5667
Conversation
public bool ValidateChain(X509Certificate2 primaryCertificate, IEnumerable<X509Certificate2> additionalCertificates) | ||
{ | ||
logger.LogVerbose($"[{nameof(CertificateChainValidator)}] Validating certificate: " + primaryCertificate); | ||
var x509Chain = new X509Chain(); |
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.
The X509Chain implements IDisposable. Wrap code in a using statement
public async Task CheckServerTrustedAsync_MultipleCertificates_ConvertsAndValidates(bool validationResult) | ||
{ | ||
var primaryCertificateDto = new X509CertificateDto("some certificate"); | ||
var additionalCertificateDto1 = new X509CertificateDto("some other certificate 1"); |
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.
Please extract the mocking of a certificate in a separate method and reuse the method in all unit tests. This will reduce the noise in this unit test and it will make it easier to understand.
Quality Gate passedIssues Measures |
36034e6
into
feature/hardening-sept-2024
SLVS-1369