Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,5 +325,28 @@ internal void MtlsHttpClientCreationFailed(Exception ex)
Level = EventLevel.Error)]
internal void MtlsHttpClientCreationFailed(string exception) =>
this.WriteEvent(34, exception);

[Event(
35,
Message = "CA configured for server validation. Subject: '{0}'.",
Level = EventLevel.Informational)]
internal void CaCertificateConfigured(string subject) =>
this.WriteEvent(35, subject);

[NonEvent]
internal void SecureHttpClientCreationFailed(Exception ex)
{
if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))
{
this.SecureHttpClientCreationFailed(ex.ToInvariantString());
}
}

[Event(
36,
Message = "Failed to create secure HttpClient. Exception: {0}",
Level = EventLevel.Error)]
internal void SecureHttpClientCreationFailed(string exception) =>
this.WriteEvent(36, exception);
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation;

/// <summary>
/// Manages certificate loading, validation, and security checks for mTLS connections.
/// Manages certificate loading, validation, and security checks for TLS connections.
/// </summary>
internal static class OtlpMtlsCertificateManager
/// <remarks>
/// This class provides functionality for both simple server certificate trust
/// (for self-signed certificates) and mTLS client authentication scenarios.
/// </remarks>
internal static class OtlpCertificateManager
{
internal const string CaCertificateType = "CA certificate";
internal const string CaCertificateType = "CA Certificate";
internal const string ClientCertificateType = "Client certificate";
internal const string ClientPrivateKeyType = "Client private key";

Expand Down Expand Up @@ -218,6 +222,10 @@ public static bool ValidateCertificateChain(
/// <param name="sslPolicyErrors">The SSL policy errors.</param>
/// <param name="caCertificate">The CA certificate to validate against.</param>
/// <returns>True if the certificate is valid; otherwise, false.</returns>
/// <remarks>
/// This method is used to validate server certificates against a CA.
/// Common use case: connecting to a server with a self-signed certificate.
/// </remarks>
internal static bool ValidateServerCertificate(
X509Certificate2 serverCert,
X509Chain chain,
Expand Down

This file was deleted.

Loading