net/servertests/client.lua
Ryan Ward 859ae91395 Reworking the library
netold contains the older library. the new library has all the core features that  was in the old library.
2018-06-15 11:29:27 -04:00

24 lines
459 B
Lua

require("socket")
ssl=require("ssl")
-- TLS/SSL client parameters (omitted)
local params = {
mode = "client",
protocol = "tlsv1_2",
key = "certs/clientAkey.pem",
certificate = "certs/clientA.pem",
cafile = "certs/rootA.pem",
verify = "peer",
options = "all"
}
local conn = socket.tcp()
conn:connect("127.0.0.1", 8888)
-- TLS/SSL initialization
conn = ssl.wrap(conn, params)
print(conn:dohandshake())
--
print(conn:receive("*l"))
conn:close()