@@ -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
220224app . 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 ( $ "\t enabled 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" ) } ") ;
249263Console . WriteLine ( $ "\t listening endpoints: { listeningEndpoints } ") ;
250264Console . WriteLine ( "--------------------------------" ) ;
251265
0 commit comments