- Add a parameter to server:sni(), so that we can accept an unknown name, using the initial context.

- Add the method :getsniname() to retrieve the SNI hostname used.
This commit is contained in:
Bruno Silvestre
2014-09-09 21:48:26 -03:00
parent 903efaf3b1
commit 84cb83b92f
3 changed files with 46 additions and 12 deletions

View File

@ -19,7 +19,8 @@ conn = ssl.wrap(conn, params)
-- Comment the lines to not send a name
--conn:sni("servera.br")
conn:sni("serveraa.br")
--conn:sni("serveraa.br")
conn:sni("serverb.br")
assert(conn:dohandshake())
--

View File

@ -39,10 +39,12 @@ local conn = server:accept()
conn = ssl.wrap(conn, ctx01)
-- Configure the name map
conn:sni({
local sni_map = {
["servera.br"] = ctx01,
["serveraa.br"] = ctx02,
})
}
conn:sni(sni_map, true)
assert(conn:dohandshake())
--