// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; using System.Security.Cryptography.X509Certificates; class MainClass { public static void Main(string[] args) { ServicePointManager.CertificatePolicy = new MySecurityPolicy(); WebRequest wr = WebRequest.Create("https://www.domain.dk/"); string html = new System.IO.StreamReader(wr.GetResponse().GetResponseStream()).ReadToEnd(); Console.WriteLine(html); } } internal class MySecurityPolicy : ICertificatePolicy { public bool CheckValidationResult(ServicePoint sPoint, X509Certificate cert, WebRequest wRequest, int certProb) { return true; } }