aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-05-05 16:03:18 +0200
committerIngela Anderton Andin <[email protected]>2015-05-12 14:04:06 +0200
commitff2400d7b5b1b090e128bc537d7bdd94c6aad97e (patch)
tree43ef1c0fdb4b7f9ce35d2dd7508e43de42325788 /lib/ssl/src/ssl.erl
parentdb509dd5debcd72d7f1d024d289315274f9b788b (diff)
downloadotp-ff2400d7b5b1b090e128bc537d7bdd94c6aad97e.tar.gz
otp-ff2400d7b5b1b090e128bc537d7bdd94c6aad97e.tar.bz2
otp-ff2400d7b5b1b090e128bc537d7bdd94c6aad97e.zip
ssl: Refactored and corrected sni_fun handling
Dialyzer warned about the incorrect match of Packets. Code was refactored and the problem avoided in the process. Dialyzer warned that the empty tuple is not a function as the contract said it should be. Changed the handling of the sni_fun default value to be undefined and added it to the contract.
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r--lib/ssl/src/ssl.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 9f76612ee3..225a9be66f 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -700,7 +700,7 @@ handle_options(Opts0) ->
log_alert = handle_option(log_alert, Opts, true),
server_name_indication = handle_option(server_name_indication, Opts, undefined),
sni_hosts = handle_option(sni_hosts, Opts, []),
- sni_fun = handle_option(sni_fun, Opts, {}),
+ sni_fun = handle_option(sni_fun, Opts, undefined),
honor_cipher_order = handle_option(honor_cipher_order, Opts, false),
protocol = proplists:get_value(protocol, Opts, tls),
padding_check = proplists:get_value(padding_check, Opts, true),
@@ -933,8 +933,8 @@ validate_option(sni_hosts, [{Hostname, SSLOptions} | Tail]) when is_list(Hostnam
_ ->
throw({error, {options, {sni_hosts, RecursiveSNIOptions}}})
end;
-validate_option(sni_fun, {}) ->
- {};
+validate_option(sni_fun, undefined) ->
+ undefined;
validate_option(sni_fun, Fun) when is_function(Fun) ->
Fun;
validate_option(honor_cipher_order, Value) when is_boolean(Value) ->