LuaSec is a binding for OpenSSL library to provide TLS/SSL communication. This version delegates to LuaSocket the TCP connection establishment between the client and server, and, since the connection is performed, it is used to start a secure TLS/SSL session.
For example, this is an implementation of a client and a server using LuaSec:
| Client | Server |
|---|---|
require("socket") |
require("socket") |
To start the secure connection, LuaSec must know some connection parameters, such as the protocol to be used, key, certificate, etc. These parameters can be passed directly to ssl.wrap, or they can be used to create a context, which is more appropriated for the server side.
The parameters are provided throught a Lua table. For example, in the above we can use these tables:
| Client | Server |
|---|---|
-- TLS/SSL client parameters |
-- TLS/SSL server parameters |
LuaSec no more provides the LuaSocket API, i.e., you must download and install the LuaSocket yourself.
All the tests were performed on Linux, Windows XP, and BSD; using Lua 5.1, LuaSocket 2.0.2, and OpenSSL 0.9.7/0.9.8.
The module uses part of LuaSocket 2.0.2, and it is available under the same terms and conditions as the Lua language and LuaSocket 2.0.2, the MIT license.
| Last update: 15-Jan-2009 10:15 |
SSL Lua SSL Lua OpenSSL Lua OpenSSL