From db509dd5debcd72d7f1d024d289315274f9b788b Mon Sep 17 00:00:00 2001 From: Qijiang Fan Date: Thu, 16 Apr 2015 22:25:57 +0800 Subject: ssl: add option sni_fun The newly added function sni_fun allows dynamic update of SSL options like keys and certificates depending on different SNI hostname, rather than a predefined rules of SSL options. --- lib/ssl/doc/src/ssl.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'lib/ssl/doc/src/ssl.xml') diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml index 77f63dcecf..8a0bf69be4 100644 --- a/lib/ssl/doc/src/ssl.xml +++ b/lib/ssl/doc/src/ssl.xml @@ -108,10 +108,12 @@

| {log_alert, boolean()}

| {server_name_indication, hostname() | disable}

| {sni_hosts, [{hostname(), ssloptions()}]}

+

| {sni_fun, SNIfun::fun()}

transportoption() =

{cb_info, {CallbackModule::atom(), DataTag::atom(), + ClosedTag::atom(), ErrTag:atom()}}

Defaults to {gen_tcp, tcp, tcp_closed, tcp_error}. Can be used to customize the transport layer. The callback module must implement a @@ -185,6 +187,9 @@

srp_1024 | srp_1536 | srp_2048 | srp_3072 | srp_4096 | srp_6144 | srp_8192

+ SNIfun::fun() +

= fun(ServerName :: string()) -> ssloptions()

+ @@ -630,7 +635,21 @@ fun(srp, Username :: string(), UserState :: term()) -> {sni_hosts, [{hostname(), ssloptions()}]}

If the server receives a SNI (Server Name Indication) from the client matching a host listed in the sni_hosts option, the speicific options for - that host will override previously specified options.

+ that host will override previously specified options. + + The option sni_fun, and sni_hosts are mutually exclusive.

+ + {sni_fun, SNIfun::fun()} +

If the server receives a SNI (Server Name Indication) from the client, + the given function will be called to retrive ssloptions() for indicated server. + These options will be merged into predefined ssloptions(). + + The function should be defined as: + fun(ServerName :: string()) -> ssloptions() + and can be specified as a fun or as named fun module:function/1 + + The option sni_fun, and sni_hosts are mutually exclusive.

+ -- cgit v1.2.3