[skip ci] Allow Insecure TLS like self-signed certificate for SMTP server (#118)
This commit is contained in:
parent
dccb7533a2
commit
923fa48a97
2
.clabot
2
.clabot
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"contributors": ["azukaar", "jwr1", "Jogai"],
|
"contributors": ["azukaar", "jwr1", "Jogai", "InterN0te"],
|
||||||
"message": "We require contributors to sign our [Contributor License Agreement](https://github.com/azukaar/Cosmos-Server/blob/master/cla.md). In order for us to review and merge your code, add yourself to the .clabot file as contributor, as a way of signing the CLA."
|
"message": "We require contributors to sign our [Contributor License Agreement](https://github.com/azukaar/Cosmos-Server/blob/master/cla.md). In order for us to review and merge your code, add yourself to the .clabot file as contributor, as a way of signing the CLA."
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,7 @@ const ConfigManagement = () => {
|
||||||
Email_Password: config.EmailConfig.Password,
|
Email_Password: config.EmailConfig.Password,
|
||||||
Email_From: config.EmailConfig.From,
|
Email_From: config.EmailConfig.From,
|
||||||
Email_UseTLS : config.EmailConfig.UseTLS,
|
Email_UseTLS : config.EmailConfig.UseTLS,
|
||||||
|
Email_AllowInsecureTLS : config.EmailConfig.AllowInsecureTLS,
|
||||||
|
|
||||||
SkipPruneNetwork: config.DockerConfig.SkipPruneNetwork,
|
SkipPruneNetwork: config.DockerConfig.SkipPruneNetwork,
|
||||||
DefaultDataPath: config.DockerConfig.DefaultDataPath || "/usr",
|
DefaultDataPath: config.DockerConfig.DefaultDataPath || "/usr",
|
||||||
|
@ -169,6 +170,7 @@ const ConfigManagement = () => {
|
||||||
Password: values.Email_Password,
|
Password: values.Email_Password,
|
||||||
From: values.Email_From,
|
From: values.Email_From,
|
||||||
UseTLS: values.Email_UseTLS,
|
UseTLS: values.Email_UseTLS,
|
||||||
|
AllowInsecureTLS: values.Email_AllowInsecureTLS,
|
||||||
},
|
},
|
||||||
DockerConfig: {
|
DockerConfig: {
|
||||||
...config.DockerConfig,
|
...config.DockerConfig,
|
||||||
|
@ -519,6 +521,15 @@ const ConfigManagement = () => {
|
||||||
formik={formik}
|
formik={formik}
|
||||||
helperText="SMTP Uses TLS"
|
helperText="SMTP Uses TLS"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{formik.values.Email_UseTLS && (
|
||||||
|
<CosmosCheckbox
|
||||||
|
label="Allow Insecure TLS"
|
||||||
|
name="Email_AllowInsecureTLS"
|
||||||
|
formik={formik}
|
||||||
|
helperText="Allow self-signed certificate"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>)}
|
</>)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</MainCard>
|
</MainCard>
|
||||||
|
|
|
@ -88,7 +88,7 @@ func SendEmail(recipients []string, subject string, body string) error {
|
||||||
auth := smtp.PlainAuth("", config.EmailConfig.Username, config.EmailConfig.Password, config.EmailConfig.Host)
|
auth := smtp.PlainAuth("", config.EmailConfig.Username, config.EmailConfig.Password, config.EmailConfig.Host)
|
||||||
|
|
||||||
tlsConfig := &tls.Config{
|
tlsConfig := &tls.Config{
|
||||||
InsecureSkipVerify: false,
|
InsecureSkipVerify: config.EmailConfig.AllowInsecureTLS,
|
||||||
ServerName: config.EmailConfig.Host,
|
ServerName: config.EmailConfig.Host,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,6 +198,7 @@ type EmailConfig struct {
|
||||||
Password string
|
Password string
|
||||||
From string
|
From string
|
||||||
UseTLS bool
|
UseTLS bool
|
||||||
|
AllowInsecureTLS bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type OpenIDClient struct {
|
type OpenIDClient struct {
|
||||||
|
|
Loading…
Reference in a new issue