Trusting all certificates using HttpClient over HTTPS

You basically have four potential solutions to fix a “Not Trusted” exception on Android using httpclient: Trust all certificates. Don’t do this, unless you really know what you’re doing. Create a custom SSLSocketFactory that trusts only your certificate. This works as long as you know exactly which servers you’re going to connect to, but as … Read more

RegEx to remove key and certificate headers and footers [duplicate]

using System; using System.Text.RegularExpressions; namespace TestRegex { class MainClass { public static void Main(string[] args) { string begin = “—–BEGIN some variable text—–“; string end = “—–END”; Console.WriteLine(Regex.Replace(begin, “—–BEGIN .*—–“, “”)); Console.WriteLine(Regex.Replace(end, “—–END.*”, “”)); Console.ReadLine(); } } }