LuaSec is a binding for OpenSSL library to provide TLS/SSL communication. It takes an already established TCP connection and creates a secure session between the peers.
This is a simple example of a client and server communication using LuaSec:
| Client | Server |
|---|---|
require("socket")
|
require("socket")
|
LuaSec needs a set of information (such as protocol, key, certificate, etc.) to wrap the TCP connection. For instance, we can use the following parameters in the example above:
| Client | Server |
|---|---|
-- TLS/SSL client parameters |
-- TLS/SSL server parameters |
LuaSec depends on LuaSocket package. On Windows, LuaSec and LuaSocket must be compiled with the same C++ Run-Time.
All tests were performed on Linux, Mac OS X, Windows XP, and BSD, using Lua 5.1.4, LuaSocket 2.0.2, and OpenSSL 0.9.8.
The modules were built using Visual C++ 2008 (version 9), Multi-threaded DLL (/MD), and OpenSSL 0.9.8 on Windows XP — see "dll9" in Lua Binaries for more information.
You can download the OpenSSL and Visual C++ 2008 Redistributables here. If you are not a developer, you can install the light version of OpenSSL.
LuaSec is available under the same terms and conditions as the Lua language — the MIT license.
| Last update: 14-Oct-2009 21:25 |
SSL Lua SSL Lua OpenSSL Lua OpenSSL