Skip to content

Commit

Permalink
Fix: Issue7388 - TLS auth failed due to unsupported Ephemeral keys (#…
Browse files Browse the repository at this point in the history
…7424)

Co-authored-by: Tanmay Yerunkar <[email protected]>
  • Loading branch information
tanmay-yerunkar-ms and Tanmay Yerunkar authored Mar 1, 2025
1 parent 8c5625d commit 962b767
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions samples/dotnet/EdgeX509AuthDownstreamDevice/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ static void Main()
Console.WriteLine("Creating device client using identity certificate...\n");

var (cert, certChain) = GetClientCertificateAndChainFromFile(DeviceIdentityCertPath, DeviceIdentityPrivateKeyPath);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
//Windows does not natively support PEM files for TLS connections due to the platform's lack of support for ephemeral keys.
//Hence need to convert the certificate to PFX format.
cert = new X509Certificate2(cert.Export(X509ContentType.Pfx));
}
InstallChainCertificates(certChain);

ITransportSettings[] transportSettings = GetTransport(ClientTransportType);
Expand Down

0 comments on commit 962b767

Please sign in to comment.