public static void OpenSSLThrow(string func) { StringBuilder sb = new StringBuilder(); OpenSSL.ERR_print_errors_cb((str, size, user) => { sb.AppendLine(str); return(0); }, IntPtr.Zero); throw new IOException("OpenSSL failed in " + func + "\n" + sb); }