Allow connecting to SSL-secured servers with self-signed certificates
Adds a new configuration parameter ('check_certificate'), which gets wired up to the rejectUnauthorized option of tls.connect.
This commit is contained in:
parent
82e2a19749
commit
0966ba909b
@ -26,7 +26,8 @@ class AuthLdap {
|
|||||||
constructor (conf) {
|
constructor (conf) {
|
||||||
const clientOpts = {
|
const clientOpts = {
|
||||||
url: conf.uri,
|
url: conf.uri,
|
||||||
maxConnections: 5
|
maxConnections: 5,
|
||||||
|
tlsOptions: { }
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -37,6 +38,10 @@ class AuthLdap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conf.check_certificate !== undefined) {
|
||||||
|
clientOpts.tlsOptions.rejectUnauthorized = conf.check_certificate
|
||||||
|
}
|
||||||
|
|
||||||
const {base: searchBase} = conf
|
const {base: searchBase} = conf
|
||||||
const searchFilter = conf.filter || '(uid={{name}})'
|
const searchFilter = conf.filter || '(uid={{name}})'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user