diff options
Diffstat (limited to 'src/eldap.erl')
-rw-r--r-- | src/eldap.erl | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/eldap.erl b/src/eldap.erl index 5f8c6f722..9763e2a79 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -565,11 +565,7 @@ get_handle(Name) when is_binary(Name) -> %% process. %%---------------------------------------------------------------------- init([Hosts, Port, Rootdn, Passwd, Opts]) -> - Encrypt = case gen_mod:get_opt(encrypt, Opts, - fun(tls) -> tls; - (starttls) -> starttls; - (none) -> none - end) of + Encrypt = case gen_mod:get_opt(encrypt, Opts) of tls -> tls; _ -> none end, @@ -581,35 +577,19 @@ init([Hosts, Port, Rootdn, Passwd, Opts]) -> end; PT -> PT end, - CacertOpts = case gen_mod:get_opt( - tls_cacertfile, Opts, - fun(S) when is_binary(S) -> - binary_to_list(S); - (undefined) -> - undefined - end) of + CacertOpts = case gen_mod:get_opt(tls_cacertfile, Opts) of undefined -> []; Path -> [{cacertfile, Path}] end, - DepthOpts = case gen_mod:get_opt( - tls_depth, Opts, - fun(I) when is_integer(I), I>=0 -> - I; - (undefined) -> - undefined - end) of + DepthOpts = case gen_mod:get_opt(tls_depth, Opts) of undefined -> []; Depth -> [{depth, Depth}] end, - Verify = gen_mod:get_opt(tls_verify, Opts, - fun(hard) -> hard; - (soft) -> soft; - (false) -> false - end, false), + Verify = gen_mod:get_opt(tls_verify, Opts, false), TLSOpts = if (Verify == hard orelse Verify == soft) andalso CacertOpts == [] -> ?WARNING_MSG("TLS verification is enabled but no CA " |