Add ignoreUnauthorized option.
This commit is contained in:
parent
e4e65e4576
commit
8cf74c88ce
@ -50,6 +50,10 @@ export const configurationSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: 'whether the connection should use SSL'
|
description: 'whether the connection should use SSL'
|
||||||
},
|
},
|
||||||
|
ignoreUnauthorized: {
|
||||||
|
type: 'boolean',
|
||||||
|
description: 'ignore certificates error (e.g. self-signed certificate)'
|
||||||
|
},
|
||||||
|
|
||||||
// FIXME: xo-web does not support edition of too nested
|
// FIXME: xo-web does not support edition of too nested
|
||||||
user: {
|
user: {
|
||||||
@ -103,6 +107,7 @@ class TransportEmailPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure ({
|
configure ({
|
||||||
|
ignoreUnauthorized,
|
||||||
transport: {
|
transport: {
|
||||||
user,
|
user,
|
||||||
password,
|
password,
|
||||||
@ -110,6 +115,13 @@ class TransportEmailPlugin {
|
|||||||
},
|
},
|
||||||
...conf
|
...conf
|
||||||
}) {
|
}) {
|
||||||
|
if (ignoreUnauthorized != null) {
|
||||||
|
(
|
||||||
|
transportConf.tls ||
|
||||||
|
(transportConf.tls = {})
|
||||||
|
).rejectUnauthorized = !ignoreUnauthorized
|
||||||
|
}
|
||||||
|
|
||||||
transportConf.auth = { user, pass: password }
|
transportConf.auth = { user, pass: password }
|
||||||
|
|
||||||
const transport = createTransport(transportConf)
|
const transport = createTransport(transportConf)
|
||||||
|
Loading…
Reference in New Issue
Block a user