mirror of
https://github.com/bitwarden/server.git
synced 2025-04-08 06:28:14 -05:00
ssl override, deprecate defaultCreds and authType
This commit is contained in:
parent
17cc1d6543
commit
a07f37e093
@ -113,9 +113,12 @@ namespace Bit.Core
|
|||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
public int Port { get; set; } = 25;
|
public int Port { get; set; } = 25;
|
||||||
public bool Ssl { get; set; } = false;
|
public bool Ssl { get; set; } = false;
|
||||||
|
public bool SslOverride { get; set; } = false;
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
|
[Obsolete]
|
||||||
public bool UseDefaultCredentials { get; set; } = false;
|
public bool UseDefaultCredentials { get; set; } = false;
|
||||||
|
[Obsolete]
|
||||||
public string AuthType { get; set; }
|
public string AuthType { get; set; }
|
||||||
public bool TrustServer { get; set; } = false;
|
public bool TrustServer { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
@ -67,10 +67,12 @@ namespace Bit.Core.Services
|
|||||||
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var useSsl = _globalSettings.Mail.Smtp.Port == 587 ? false : _globalSettings.Mail.Smtp.Ssl;
|
var useSsl = _globalSettings.Mail.Smtp.Port == 587 && !_globalSettings.Mail.Smtp.SslOverride ?
|
||||||
|
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(!_globalSettings.Mail.Smtp.UseDefaultCredentials)
|
if(!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Username) &&
|
||||||
|
!string.IsNullOrWhiteSpace(_globalSettings.Mail.Smtp.Password))
|
||||||
{
|
{
|
||||||
await client.AuthenticateAsync(_globalSettings.Mail.Smtp.Username,
|
await client.AuthenticateAsync(_globalSettings.Mail.Smtp.Username,
|
||||||
_globalSettings.Mail.Smtp.Password);
|
_globalSettings.Mail.Smtp.Password);
|
||||||
|
@ -104,11 +104,10 @@ namespace Bit.Setup
|
|||||||
["globalSettings__yubico__key"] = "REPLACE",
|
["globalSettings__yubico__key"] = "REPLACE",
|
||||||
["globalSettings__mail__replyToEmail"] = $"no-reply@{_context.Config.Domain}",
|
["globalSettings__mail__replyToEmail"] = $"no-reply@{_context.Config.Domain}",
|
||||||
["globalSettings__mail__smtp__host"] = "REPLACE",
|
["globalSettings__mail__smtp__host"] = "REPLACE",
|
||||||
|
["globalSettings__mail__smtp__port"] = "587",
|
||||||
|
["globalSettings__mail__smtp__ssl"] = "false",
|
||||||
["globalSettings__mail__smtp__username"] = "REPLACE",
|
["globalSettings__mail__smtp__username"] = "REPLACE",
|
||||||
["globalSettings__mail__smtp__password"] = "REPLACE",
|
["globalSettings__mail__smtp__password"] = "REPLACE",
|
||||||
["globalSettings__mail__smtp__ssl"] = "true",
|
|
||||||
["globalSettings__mail__smtp__port"] = "587",
|
|
||||||
["globalSettings__mail__smtp__useDefaultCredentials"] = "false",
|
|
||||||
["globalSettings__disableUserRegistration"] = "false",
|
["globalSettings__disableUserRegistration"] = "false",
|
||||||
["adminSettings__admins"] = string.Empty,
|
["adminSettings__admins"] = string.Empty,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user