|
|
|
@ -2,6 +2,7 @@ const Unit = require('libflitter/Unit')
|
|
|
|
|
const LDAP = require('ldapjs')
|
|
|
|
|
const Validator = require('email-validator')
|
|
|
|
|
const net = require('net')
|
|
|
|
|
const fs = require('fs')
|
|
|
|
|
|
|
|
|
|
// TODO support logging ALL ldap requests when in DEBUG, not just routed ones
|
|
|
|
|
// TODO need to support LDAP server auto-discovery/detection features
|
|
|
|
@ -77,7 +78,11 @@ class LDAPServerUnit extends Unit {
|
|
|
|
|
|
|
|
|
|
// If Flitter is configured to use an SSL certificate,
|
|
|
|
|
// use it to enable LDAPS in the server.
|
|
|
|
|
if ( this.express.use_ssl() ) {
|
|
|
|
|
if ( this.config.ssl?.enable ) {
|
|
|
|
|
this.output.info('Using configured SSL certificate. The LDAP server will require an ldaps:// connection.')
|
|
|
|
|
server_config.certificate = fs.readFileSync(this.config.ssl.certificate)
|
|
|
|
|
server_config.key = fs.readFileSync(this.config.ssl.key)
|
|
|
|
|
} else if ( this.express.use_ssl() ) {
|
|
|
|
|
this.output.info('Using configured SSL certificate. The LDAP server will require an ldaps:// connection.')
|
|
|
|
|
server_config.certificate = await this.express.ssl_certificate()
|
|
|
|
|
server_config.key = await this.express.ssl_key()
|
|
|
|
|