LDAP - allow specifying certificate file
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e6a7070589
commit
6a4f82611b
@ -2,6 +2,7 @@ const Unit = require('libflitter/Unit')
|
|||||||
const LDAP = require('ldapjs')
|
const LDAP = require('ldapjs')
|
||||||
const Validator = require('email-validator')
|
const Validator = require('email-validator')
|
||||||
const net = require('net')
|
const net = require('net')
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
// TODO support logging ALL ldap requests when in DEBUG, not just routed ones
|
// TODO support logging ALL ldap requests when in DEBUG, not just routed ones
|
||||||
// TODO need to support LDAP server auto-discovery/detection features
|
// 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,
|
// If Flitter is configured to use an SSL certificate,
|
||||||
// use it to enable LDAPS in the server.
|
// 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.')
|
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.certificate = await this.express.ssl_certificate()
|
||||||
server_config.key = await this.express.ssl_key()
|
server_config.key = await this.express.ssl_key()
|
||||||
|
@ -5,6 +5,12 @@ const ldap_server = {
|
|||||||
max_connections: env('LDAP_MAX_CONNECTIONS'),
|
max_connections: env('LDAP_MAX_CONNECTIONS'),
|
||||||
interface: env('LDAP_LISTEN_INTERFACE', '0.0.0.0'),
|
interface: env('LDAP_LISTEN_INTERFACE', '0.0.0.0'),
|
||||||
|
|
||||||
|
ssl: {
|
||||||
|
enable: env('LDAP_SSL_ENABLE', false),
|
||||||
|
certificate: env('LDAP_CERT_PATH'),
|
||||||
|
key: env('LDAP_CERT_KEY_PATH'),
|
||||||
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
base_dc: env('LDAP_BASE_DC', 'dc=example,dc=com'),
|
base_dc: env('LDAP_BASE_DC', 'dc=example,dc=com'),
|
||||||
authentication_base: env('LDAP_AUTH_BASE', 'ou=people'),
|
authentication_base: env('LDAP_AUTH_BASE', 'ou=people'),
|
||||||
|
Loading…
Reference in New Issue
Block a user