Skip to content

Commit 9ad6d41

Browse files
committed
more data
1 parent da8516d commit 9ad6d41

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/BenchmarksApps/TLS/Kestrel/Program.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,15 @@ bool AllowAnyCertificateValidationWithLogging(X509Certificate2 certificate, X509
173173
{
174174
logged = true;
175175

176-
var tlsHandshakeFeature = context.Features.GetRequiredFeature<ITlsHandshakeFeature>();
176+
var tlsFeature = context.Features.GetRequiredFeature<ITlsHandshakeFeature>();
177177

178178
Console.WriteLine("Request details:");
179179
Console.WriteLine("-----");
180-
Console.WriteLine("TLS: " + tlsHandshakeFeature.Protocol);
180+
Console.WriteLine($"Protocol: {tlsFeature.Protocol}");
181+
Console.WriteLine($"CipherSuite: {tlsFeature.NegotiatedCipherSuite}");
182+
Console.WriteLine($"CipherAlgorithm: {tlsFeature.CipherAlgorithm}");
183+
Console.WriteLine($"KeyExchangeAlgorithm: {tlsFeature.KeyExchangeAlgorithm}");
184+
Console.WriteLine("TLS: " + tlsFeature.Protocol);
181185
Console.WriteLine("-----");
182186
}
183187

@@ -218,7 +222,7 @@ bool AllowAnyCertificateValidationWithLogging(X509Certificate2 certificate, X509
218222
}
219223

220224
app.MapGet("/hello-world", () =>
221-
{
225+
{
222226
return Results.Ok("Hello World!");
223227
});
224228

@@ -246,6 +250,16 @@ bool AllowAnyCertificateValidationWithLogging(X509Certificate2 certificate, X509
246250
{
247251
Console.WriteLine($"\tenabled logging stats to console");
248252
}
253+
254+
if (!(OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
255+
{
256+
#pragma warning disable CA1416 // Validate platform compatibility
257+
Console.WriteLine($"OpenSSL: {System.Security.Cryptography.SafeEvpPKeyHandle.OpenSslVersion}");
258+
#pragma warning restore CA1416 // Validate platform compatibility
259+
}
260+
261+
Console.WriteLine($"OPENSSL_CONF: {Environment.GetEnvironmentVariable("OPENSSL_CONF")}");
262+
Console.WriteLine($"LD_LIBRARY_PATH: {Environment.GetEnvironmentVariable("LD_LIBRARY_PATH")}");
249263
Console.WriteLine($"\tlistening endpoints: {listeningEndpoints}");
250264
Console.WriteLine("--------------------------------");
251265

0 commit comments

Comments
 (0)