How to get TLS / SSL related information in ASP.NET Core?

I would like more information about the current TLS / SSL request in ASP.NET Core MVC.

using Microsoft.AspNetCore.Mvc;

namespace WebApp.Controllers
{
    public class HomeController : Controller
    {        
        public IActionResult About()
        {
            if (HttpContext.Request.IsHttps)
            {
                // How to get more information about the transport layer ?

                ViewData["Message"] = "Connection via TLS/SSL - ... missing details ...";
            }

            return View();
        }        
    }
}

Is there a way to access properties such as the version of TLS used, cipher, etc.

I know this is not possible in ASP.NET MVC, as indicated in Check ssl protocol, cipher and other properties in asp.net mvc 4 application . Perhaps the new structure with Kestrel offers information that I have not yet been able to find.

+4
source share

Source: https://habr.com/ru/post/1651654/


All Articles