diff options
author | Emile Joubert <emile@rabbitmq.com> | 2013-10-08 17:30:06 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2013-10-08 17:30:06 +0100 |
commit | ab20cb6125e2fb9ed1ac156f51784a11ff01ad5a (patch) | |
tree | 156dc7439bbd189e3188ed95bf19fd805921aa09 /src | |
parent | b725d82cd5be0dbb7f8fe8c7f516d3853ecb79ff (diff) | |
download | rabbitmq-server-ab20cb6125e2fb9ed1ac156f51784a11ff01ad5a.tar.gz |
Support config-supplied verify_fun in tuple-format
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_networking.erl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 46cfabe3..aa54d6c5 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -149,14 +149,23 @@ ensure_ssl() -> ok = app_utils:start_applications(SslAppsConfig), {ok, SslOptsConfig} = application:get_env(rabbit, ssl_options), - % unknown_ca errors are silently ignored prior to R14B unless we - % supply this verify_fun - remove when at least R14B is required - case proplists:get_value(verify, SslOptsConfig, verify_none) of - verify_none -> SslOptsConfig; - verify_peer -> [{verify_fun, fun([]) -> true; - ([_|_]) -> false - end} - | SslOptsConfig] + case rabbit_misc:pget(verify_fun, SslOptsConfig) of + {Module, Function} -> + rabbit_misc:pset(verify_fun, + fun (OtpCert, Event, State) -> + apply(Module, Function, + [OtpCert, Event, State]) + end, SslOptsConfig); + undefined -> + % unknown_ca errors are silently ignored prior to R14B unless we + % supply this verify_fun - remove when at least R14B is required + case proplists:get_value(verify, SslOptsConfig, verify_none) of + verify_none -> SslOptsConfig; + verify_peer -> [{verify_fun, fun([]) -> true; + ([_|_]) -> false + end} + | SslOptsConfig] + end end. ssl_transform_fun(SslOpts) -> |