private void LogSSLSettings() { StringBuilder sSSL = new StringBuilder("SSL/TLS requested: "); // Build list of protocols that are enabled List <string> protocols = new List <string>(); if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Ssl3) == SecurityProtocolType.Ssl3) { protocols.Add("SSL 3.0"); } if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Tls) == SecurityProtocolType.Tls) { protocols.Add("TLS 1.0"); } if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Tls11) == SecurityProtocolType.Tls11) { protocols.Add("TLS 1.1"); } if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Tls12) == SecurityProtocolType.Tls12) { protocols.Add("TLS 1.2"); } sSSL.Append(String.Join("; ", protocols)); _logger.Log(sSSL.ToString(), "Connection Security"); }
private void Log(string Details, string Description = "", string ClientRequestId = "") { try { if (_logger == null) { return; } _logger.Log(Details, Description, ClientRequestId); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message, "Failed to log information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void Log(string Details, string Description = "") { try { if (_Logger == null) { return; } _Logger.Log(Details, Description); } catch { } }
private void LogCredentials() { StringBuilder sCredentialInfo = new StringBuilder(); if (radioButtonDefaultCredentials.Checked) { sCredentialInfo.AppendLine("Using default credentials"); sCredentialInfo.Append("Username: "******"Domain: "); sCredentialInfo.AppendLine(Environment.UserDomainName); } else if (radioButtonCertificateAuthentication.Checked) { sCredentialInfo.AppendLine("Using certificate"); if (_authCertificate != null) { sCredentialInfo.Append("Subject: "); sCredentialInfo.AppendLine(_authCertificate.Subject); } else { sCredentialInfo.AppendLine("NO CERTIFICATE SPECIFIED"); } } else { sCredentialInfo.AppendLine("Using specific credentials"); if (checkBoxForceBasicAuth.Checked) { sCredentialInfo.AppendLine("Forcing BASIC AUTH"); } sCredentialInfo.Append("Username: "******"Domain: "); sCredentialInfo.AppendLine(textBoxDomain.Text); } _logger.Log(sCredentialInfo.ToString(), "Request Credentials"); }