Skip to content
Snippets Groups Projects
Commit 847a4caf authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Switching branch to support customer

parent 2e5bd2bf
No related branches found
No related tags found
1 merge request!9.NET-SDK: SET-Empfang inkl. Signaturprüfung - Ticket 562
FitConnect
\ No newline at end of file
......@@ -29,10 +29,9 @@ public class CertificateHelper {
if (rootCertificate != null) {
certificateChain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
certificateChain.ChainPolicy.ExtraStore.AddRange(rootCertificate);
certificateChain.ChainPolicy.CustomTrustStore.AddRange(rootCertificate);
certificateChain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
certificateChain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
certificateChain.ChainPolicy.RevocationMode = X509RevocationMode.Offline;
certificateChain.ChainPolicy.RevocationFlag = X509RevocationFlag.ExcludeRoot;
certificateChain.ChainPolicy.DisableCertificateDownloads = false;
certificateChain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags;
_logger?.LogDebug("Using custom root certificate");
......@@ -53,7 +52,7 @@ public class CertificateHelper {
var statusAggregation = certificateChain.ChainStatus.Aggregate("",
(r, s) => r + "\n\t - " + s.Status + ": " + s.StatusInformation);
if (!result)
if (certificateChain.ChainStatus.Length > 0)
_logger?.Log(logLevel, "Certificate status: {ObjStatusInformation}",
statusAggregation);
......@@ -76,7 +75,7 @@ public class CertificateHelper {
var valid = certificates.Aggregate(true,
(result, cert) => result
&& ValidateCertificate(cert, out _, root, logLevel)
// && cert.Verify()
// && cert.Verify()
);
return valid;
}
......
......@@ -162,7 +162,8 @@ public class CertificateValidation {
shouldFail ? LogLevel.Warning : LogLevel.Critical, new[] {
new X509Certificate2("./certificates/root.pem"),
new X509Certificate2("./certificates/ca.30244.der"),
new X509Certificate2("./certificates/ca.21636.der")
new X509Certificate2("./certificates/ca.26305.der"),
new X509Certificate2("./certificates/ca.26281.der")
});
if (shouldFail)
......
......@@ -66,6 +66,12 @@
<None Update="certificates\invalidEncJwkWithLessThan3Certificates.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="certificates\ca.26281.der">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="certificates\ca.26305.der">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment