I have a window application made in c#, I need a code to check an https url is reachable and having a valid certificate then i need to display a MessageBox with validation successfully done elese respective error
private void btnValidateSettings_Click(object sender, EventArgs e)
{
HttpClient httpClient = new HttpClient();
try
{
string url = txtAAServerName.Text + "myApi";
MessageBox.Show(url);
string serverName = (chkBoxSSL.Checked == true) ? "https://" + txtAAServerName.Text : "http://" + txtAAServerName.Text;
MessageBox.Show(serverName);
var result = httpClient.GetAsync(serverName + "myApi");
_log.Error("Error Result html"+result);
MessageBox.Show("Validated Successfully!");