server: make host configurable to enable IPv6 support
This change also separates the API host and the LDAP host for further customization.
This commit is contained in:
@@ -177,7 +177,7 @@ where
|
||||
|
||||
info!("Starting the LDAP server on port {}", config.ldap_port);
|
||||
let server_builder = server_builder
|
||||
.bind("ldap", ("0.0.0.0", config.ldap_port), binder)
|
||||
.bind("ldap", (config.ldap_host.clone(), config.ldap_port), binder)
|
||||
.with_context(|| format!("while binding to the port {}", config.ldap_port));
|
||||
if config.ldaps_options.enabled {
|
||||
let tls_context = (
|
||||
@@ -212,8 +212,12 @@ where
|
||||
config.ldaps_options.port
|
||||
);
|
||||
server_builder.and_then(|s| {
|
||||
s.bind("ldaps", ("0.0.0.0", config.ldaps_options.port), tls_binder)
|
||||
.with_context(|| format!("while binding to the port {}", config.ldaps_options.port))
|
||||
s.bind(
|
||||
"ldaps",
|
||||
(config.ldap_host.clone(), config.ldaps_options.port),
|
||||
tls_binder,
|
||||
)
|
||||
.with_context(|| format!("while binding to the port {}", config.ldaps_options.port))
|
||||
})
|
||||
} else {
|
||||
server_builder
|
||||
|
||||
Reference in New Issue
Block a user