Skip to content

Commit 797816c

Browse files
committed
fix(): support new grpc client
1 parent e77d6e1 commit 797816c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ internal HttpClient AddCertificatesToHttpClient(HttpClientHandler handler)
273273
chain.ChainPolicy.CustomTrustStore.Add(trustedCertificate);
274274
return chain.Build(cert);
275275
}
276+
276277
return false;
277278
};
278279
}

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptionsExtensions.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static Channel CreateChannel(this OtlpExporterOptions options)
4242
string clientKeyPem = System.IO.File.ReadAllText(options.ClientKeyFile);
4343
var keyPair = new KeyCertificatePair(clientCertPem, clientKeyPem);
4444

45-
string? rootCertPem = null;
45+
string rootCertPem = string.Empty;
4646
if (!string.IsNullOrEmpty(options.CertificateFile))
4747
{
4848
rootCertPem = System.IO.File.ReadAllText(options.CertificateFile);
@@ -52,11 +52,12 @@ public static Channel CreateChannel(this OtlpExporterOptions options)
5252
}
5353
else
5454
{
55-
string? rootCertPem = null;
55+
string rootCertPem = string.Empty;
5656
if (!string.IsNullOrEmpty(options.CertificateFile))
5757
{
5858
rootCertPem = System.IO.File.ReadAllText(options.CertificateFile);
5959
}
60+
6061
channelCredentials = new SslCredentials(rootCertPem);
6162
}
6263
}

0 commit comments

Comments
 (0)