aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls.erl
diff options
context:
space:
mode:
authorJulien Barbot <[email protected]>2013-11-03 21:30:03 +0100
committerFredrik Gustafsson <[email protected]>2013-11-06 11:13:59 +0100
commitd370fe05f5884691a89784aa73bfb4eb2176edab (patch)
treee7f1fcff06fa24a17a904159def346506765822e /lib/ssl/src/tls.erl
parentbc8b6bf58c96f8d5a07146ddea145f71fe8c8956 (diff)
downloadotp-d370fe05f5884691a89784aa73bfb4eb2176edab.tar.gz
otp-d370fe05f5884691a89784aa73bfb4eb2176edab.tar.bz2
otp-d370fe05f5884691a89784aa73bfb4eb2176edab.zip
Add a new server_name_indication option to ssl:connect
- Set to disable to explicitly disable SNI support. - Set to a hostname when upgrading from TCP to TLS.
Diffstat (limited to 'lib/ssl/src/tls.erl')
-rw-r--r--lib/ssl/src/tls.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssl/src/tls.erl b/lib/ssl/src/tls.erl
index b220a48f73..f1747dc69e 100644
--- a/lib/ssl/src/tls.erl
+++ b/lib/ssl/src/tls.erl
@@ -664,7 +664,8 @@ handle_options(Opts0, _Role) ->
next_protocol_selector =
make_next_protocol_selector(
handle_option(client_preferred_next_protocols, Opts, undefined)),
- log_alert = handle_option(log_alert, Opts, true)
+ log_alert = handle_option(log_alert, Opts, true),
+ server_name_indication = handle_option(server_name_indication, Opts, undefined)
},
CbInfo = proplists:get_value(cb_info, Opts, {gen_tcp, tcp, tcp_closed, tcp_error}),
@@ -855,6 +856,12 @@ validate_option(next_protocols_advertised = Opt, Value) when is_list(Value) ->
validate_option(next_protocols_advertised, undefined) ->
undefined;
+validate_option(server_name_indication, Value) when is_list(Value) ->
+ Value;
+validate_option(server_name_indication, disable) ->
+ disable;
+validate_option(server_name_indication, undefined) ->
+ undefined;
validate_option(Opt, Value) ->
throw({error, {options, {Opt, Value}}}).