Skip to content

Commit

Permalink
PR Review Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
swetharavichandrancisco committed Mar 30, 2022
1 parent 41e68d3 commit 0b5d9a9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ public void FailedToInjectActivityContext(string format, string error)
this.WriteEvent(2, format, error);
}

[Event(2, Message = "Failed to validate certificate in format: '{0}', error: '{1}'.", Level = EventLevel.Warning)]
public void FailedToValidateCertificate(string format, string error)
{
this.WriteEvent(2, format, error);
}

[Event(3, Message = "Failed to extract resource attributes in '{0}'.", Level = EventLevel.Warning)]
public void FailedToExtractResourceAttributes(string format, string exception)
{
this.WriteEvent(3, format, exception);
}

[Event(4, Message = "Failed to validate certificate in format: '{0}', error: '{1}'.", Level = EventLevel.Warning)]
public void FailedToValidateCertificate(string format, string error)
{
this.WriteEvent(4, format, error);
}

/// <summary>
/// Returns a culture-independent string representation of the given <paramref name="exception"/> object,
/// appropriate for diagnostics tracing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<Compile Remove="Resources\AWSEKSResourceDetector.cs" />
<Compile Remove="Resources\AWSLambdaResourceDetector.cs" />
<Compile Remove="Resources\Http\Handler.cs" />
<Compile Remove="Resources\Http\ServerCertificateValidationProvider.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

using System;
using System.IO;
using System.Linq;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

Expand Down Expand Up @@ -66,7 +67,7 @@ private static bool LoadCertificateToTrustedCollection(X509Certificate2Collectio
{
try
{
collection.Import(certFileName, null, (X509KeyStorageFlags)32);
collection.Import(certFileName);
return true;
}
catch (Exception)
Expand Down Expand Up @@ -143,7 +144,7 @@ private bool HasCommonCertificate(X509Chain chain, X509Certificate2Collection co
{
foreach (var certificate in collection)
{
if (chainElement.Certificate.GetPublicKey().SequenceEqual(certificate.GetPublicKey()))
if (Enumerable.SequenceEqual(chainElement.Certificate.GetPublicKey(), certificate.GetPublicKey()))
{
return true;
}
Expand Down

This file was deleted.

0 comments on commit 0b5d9a9

Please sign in to comment.