mirror of
https://github.com/bitwarden/server.git
synced 2024-11-29 13:25:17 +01:00
force SecureSocketOptions.none if 25 w/ no ssl
This commit is contained in:
parent
01a293cf76
commit
625ed1a1ee
@ -67,9 +67,17 @@ namespace Bit.Core.Services
|
|||||||
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!_globalSettings.Mail.Smtp.Ssl && _globalSettings.Mail.Smtp.Port == 25)
|
||||||
|
{
|
||||||
|
await client.ConnectAsync(_globalSettings.Mail.Smtp.Host, _globalSettings.Mail.Smtp.Port,
|
||||||
|
MailKit.Security.SecureSocketOptions.None);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
var useSsl = _globalSettings.Mail.Smtp.Port == 587 && !_globalSettings.Mail.Smtp.SslOverride ?
|
var useSsl = _globalSettings.Mail.Smtp.Port == 587 && !_globalSettings.Mail.Smtp.SslOverride ?
|
||||||
false : _globalSettings.Mail.Smtp.Ssl;
|
false : _globalSettings.Mail.Smtp.Ssl;
|
||||||
await client.ConnectAsync(_globalSettings.Mail.Smtp.Host, _globalSettings.Mail.Smtp.Port, useSsl);
|
await client.ConnectAsync(_globalSettings.Mail.Smtp.Host, _globalSettings.Mail.Smtp.Port, useSsl);
|
||||||
|
}
|
||||||
|
|
||||||
if(!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Username) &&
|
if(!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Username) &&
|
||||||
!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Password))
|
!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Password))
|
||||||
|
Loading…
Reference in New Issue
Block a user