Add ignoreUnauthorized option.

This commit is contained in:
Julien Fontanet 2016-02-22 16:03:33 +01:00
parent e4e65e4576
commit 8cf74c88ce

View File

@ -50,6 +50,10 @@ export const configurationSchema = {
type: 'boolean',
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
user: {
@ -103,6 +107,7 @@ class TransportEmailPlugin {
}
configure ({
ignoreUnauthorized,
transport: {
user,
password,
@ -110,6 +115,13 @@ class TransportEmailPlugin {
},
...conf
}) {
if (ignoreUnauthorized != null) {
(
transportConf.tls ||
(transportConf.tls = {})
).rejectUnauthorized = !ignoreUnauthorized
}
transportConf.auth = { user, pass: password }
const transport = createTransport(transportConf)