How to obtain https certificate information using HttpClient

浩 李 0 Reputation points
2023-03-18T17:10:58.8733333+00:00
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://xxx.com");
                    
                    //request.UserAgent = "Mozilla/5.0 
                    request.Method = "GET";
                    request.Timeout = 2000;

                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        var ret = request.ServicePoint.Certificate;
}
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,138 questions
{count} votes