My program uses SHA-1 certificate for SSL connection. The SHA-2 certificate has been widely used now by some web services (Gmail) instead. This causes blocking incoming connection to SMTP servers during email notification setup.
To send email I use SmtpClient like this
using (var smtpClient = new SmtpClient(serverSettings.SmtpServerName, (int)serverSettings.SmtpPort))
{
smtpClient.EnableSsl = serverSettings.SmtpUseSsl;
smtpClient.UseDefaultCredentials = false;
if (!string.IsNullOrEmpty(serverSettings.UserName) || !string.IsNullOrEmpty(serverSettings.EncryptedPassword))
{
smtpClient.Credentials = new NetworkCredential(serverSettings.UserName, serverSettings.EncryptedPassword);
}
...
smtpClient.Send(message);
}
I can't send an email by using this code and I don't want to allow "less secure apps" in my gmail account.
How to implement or switch to SHA-2 certificate for email notifications?