diff options
Diffstat (limited to 'src/eldap.erl')
-rw-r--r-- | src/eldap.erl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/eldap.erl b/src/eldap.erl index a9edebdf0..f8f6d04a9 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -80,11 +80,10 @@ -export([get_status/1]). -%% gen_fsm callbacks -export([init/1, connecting/2, connecting/3, wait_bind_response/3, active/3, active_bind/3, handle_event/3, handle_sync_event/4, handle_info/3, - terminate/3, code_change/4]). + terminate/3, code_change/4, mod_opt_type/1]). -export_type([filter/0]). @@ -1194,3 +1193,24 @@ bump_id(#eldap{id = Id}) when Id > (?MAX_TRANSACTION_ID) -> ?MIN_TRANSACTION_ID; bump_id(#eldap{id = Id}) -> Id + 1. + +mod_opt_type(encrypt) -> + fun (tls) -> tls; + (starttls) -> starttls; + (none) -> none + end; +mod_opt_type(tls_cacertfile) -> + fun (S) when is_binary(S) -> binary_to_list(S); + (undefined) -> undefined + end; +mod_opt_type(tls_depth) -> + fun (I) when is_integer(I), I >= 0 -> I; + (undefined) -> undefined + end; +mod_opt_type(tls_verify) -> + fun (hard) -> hard; + (soft) -> soft; + (false) -> false + end; +mod_opt_type(_) -> + [encrypt, tls_cacertfile, tls_depth, tls_verify]. |