How to

download X.509 certificate from url

Published: 28. December 2014 | Updated: 28. December 2014
License: Microsoft Public License (MS-PL)
Categories: Security
Tags: C# Security
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at

Import namespaces

using System;
using System.Net;
using System.Security.Cryptography.X509Certificates;


var request = (HttpWebRequest)WebRequest.Create("");
var response = (HttpWebResponse)request.GetResponse();

X509Certificate cert = request.ServicePoint.Certificate;
var x509 = new X509Certificate2(cert);

Send us feedback about this snippet »

Related Snippets: